Skip to content
Prev 324676 / 398503 Next

Read 2 rows in 1 dataframe for diff - longitudinal data

On Jun 3, 2013, at 7:10 PM, arun wrote:

            
It's pretty simple with logical indexing:
subid year var
3     36 2003   3
6     47 1999   1
7     47 2001   3
9     47 2005   1
10    47 2007   3


When I count the number of changes in value of var is give me 5. Not sure why you are both leaving out row 6.