Dear Stata Listserv,
I’m seeking help with how to lag variables in a three-level mixed effects model using the mixed command. Level 1 is individuals, level 2 is the country-year, and level 3 is the country.
Before my current project, I was working with country-year (pooled time-series) data, using the mixed command. With these data, it was a simple matter to xtset the data <xtset country year> and then use the L. operator to lag any time-varying variables. More recently, however, I merged in individual-level data from the World Values Survey into this existing country-year dataset. So the basic unit of analysis is now the individual person (nested within survey years, nested within countries). With the individual-level data merged in, Stata (version 15) is no longer allowing me to xtset the data, so I can’t use the L. operator. However, I still want to lag my country-level time-varying variables by one year or more. How can I do that?
Thanks a lot,
Louisa
Related Posts with How to Lag Variables in a Three-Level Mixed Effects Model
GMM coefficientsHi statalisters, I have some doubt about the dynamic short panel data estimation. When one makes an…
Recoding into an existing variableHello, I am trying to add text responses to an existing variable. I have a variable Q33_20_TEXT th…
Collapse (count) ifDear Stata Users My data is in a panel format at the daily frequency (id, date). I run time-series …
plotting interaction after XTSCC commandHow do I plot interactions after the XTSCC command? …
Confusion about FE and DIDHello everyone, this is my first post here so please excuse me if the formatting is not great yet. I…
Subscribe to:
Post Comments (Atom)
0 Response to How to Lag Variables in a Three-Level Mixed Effects Model
Post a Comment