I am going to be running multilevel (longitudinal) logistic regression using gllamm. I need to lag most of my variables by one year prior to performing this analysis. Important to note is that I need to lag by subject, which is Garden_ID_ . My data is currently in the "long" format. For simplicity, in this example I will need to lag Var 1 and Var2, but not var 3.
Do I need to make new lagged variables to run gllamm, and if so what's the easiest way to do that?
Many thanks,
Alyssa
Do I need to make new lagged variables to run gllamm, and if so what's the easiest way to do that?
Garden_ID_ | Year | Var1 | Var2 | Var3 |
1 | 2012 | |||
1 | 2013 | |||
1 | 2014 | |||
1 | 2015 | |||
2 | 2012 | |||
2 | 2013 | |||
2 | 2014 | |||
2 | 2015 |
Alyssa
Comment