Hello everyone,
I am doing a panel data analysis on elections. Basically, my data set has a variable suffrage ("sufr") that measures the proportion of population that has suffrage for a country in a single year.
I created a dummy variable, "suffrage_dummy" that I want to code 0 or 1 with the following criteria:
- if the difference between the proportion of suffrage in year x & x+1 is 1, dummy = 1; otherwise = 0
In other words, if suffrage this year is 1 and last year it was 0, then dummy value = 1. For all others, dummy = 0. I tried doing some if commands on my own but it isn't working. Any help will be much appreciated. Thanks.
Ashvinder
I am doing a panel data analysis on elections. Basically, my data set has a variable suffrage ("sufr") that measures the proportion of population that has suffrage for a country in a single year.
I created a dummy variable, "suffrage_dummy" that I want to code 0 or 1 with the following criteria:
- if the difference between the proportion of suffrage in year x & x+1 is 1, dummy = 1; otherwise = 0
In other words, if suffrage this year is 1 and last year it was 0, then dummy value = 1. For all others, dummy = 0. I tried doing some if commands on my own but it isn't working. Any help will be much appreciated. Thanks.
Ashvinder
Comment