Hello everyone,
I am conducting research on volume of transactions around elections. I merged two datasets, one with the transactions and one with the elections for all the european countries. Within the merged dataset, I have 3 different date variables, date which is every single date between 1.1.2000 and 31.12.2019 (my sample period), edate which is the election date and transaction date. Within the merge, everything worked fine as the transactions were assigned to the correct country, but not to the closest election in that country (for example a transaction from 2002 has assigned the election date value for an election from 2019, even though there was an election in 2005 in that country). How can I make it so the edate for the transactions that have the wrong one are replaced with the date of the closest one for that country? Thank you for your time
I am conducting research on volume of transactions around elections. I merged two datasets, one with the transactions and one with the elections for all the european countries. Within the merged dataset, I have 3 different date variables, date which is every single date between 1.1.2000 and 31.12.2019 (my sample period), edate which is the election date and transaction date. Within the merge, everything worked fine as the transactions were assigned to the correct country, but not to the closest election in that country (for example a transaction from 2002 has assigned the election date value for an election from 2019, even though there was an election in 2005 in that country). How can I make it so the edate for the transactions that have the wrong one are replaced with the date of the closest one for that country? Thank you for your time
Comment