Hello. I have cross-national time-series dataset from 1990 to 2016
I am studying the effect of a decreasing democracy score, and i have a question as i want to create a binary variable that gives a value of 1 if the democracy variable is statistically lower than the year before, and 0 if not, so that i can use an if command to only observe drops in democracy and not increases.
So if for example the variable has a value of 7 in year 1999 and a value of 5 in 2000, the binary variable would then give me a 1.
Furthermore, to check and see how much effect the drop has i have tried to make a variable that is simply the difference of said democracy variable from year to year+1. I tried using a command such as
gen diff = var-(var_n-1]) but that messed it up when it changes countries in the variables
Thank you
I am studying the effect of a decreasing democracy score, and i have a question as i want to create a binary variable that gives a value of 1 if the democracy variable is statistically lower than the year before, and 0 if not, so that i can use an if command to only observe drops in democracy and not increases.
So if for example the variable has a value of 7 in year 1999 and a value of 5 in 2000, the binary variable would then give me a 1.
Furthermore, to check and see how much effect the drop has i have tried to make a variable that is simply the difference of said democracy variable from year to year+1. I tried using a command such as
gen diff = var-(var_n-1]) but that messed it up when it changes countries in the variables
Thank you

Comment