I have a dataset with two dates (date A and date B). I want to find rows where date A matches any date B within the same id variable.
id date A date B
1 01/20/2018 02/25/2019
1 01/20/2018 01/20/2018
2 03/18/2017 03/20/2019
2 03/18/2017 04/19/2018
2 03/20/2019 03/20/2019
2 03/20/2019 04/19/2018
3 08/01/2019 09/06/2019
I want the output to produce a boolean variable 'date_match':
id date A date B date_match
1 01/20/2018 02/25/2019 TRUE
1 01/20/2018 01/20/2018 TRUE
2 03/18/2017 03/20/2019 FALSE
2 03/18/2017 04/19/2018 FALSE
2 03/20/2019 03/20/2019 TRUE
2 03/20/2019 04/19/2018 TRUE
3 08/01/2019 09/06/2019 FALSE
Thanks!