I have a table:
country election party vote
usa 1/1/2000 dem 48
usa 1/1/2004 dem 49
usa 1/1/2008 dem 51
usa 1/1/2012 dem 50
I want to create a new column, called, votelagged, which calculates the difference between one vote and the previous vote so that it would read:
null
1
2
-1
Various statistical packages do this as a built-in feature, but I can't figure out how to do it manually. Thanks for the consideration.
Tom