Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: lags with multiply imputed panel data
From
Daniel Miller <[email protected]>
To
[email protected]
Subject
st: lags with multiply imputed panel data
Date
Tue, 23 Feb 2010 10:36:31 -0500
Hello all --
I am having trouble getting Stata to implement lags (using the L. command)
on my dataset of multiply imputed panel data.
I reshaped the data from wide form to long form in the following way:
gen i =_mi
mim, cat(manip) sortorder(idnum i): xtset idnum wave
where idnum is the unique identifier for respondents and wave is the time
variable (4 time points).
In browse view, the data look like:
*_mj _mi i idnum wave*
1 1 1 1000001 1
1 2 2 1000001 2
1 3 3 1000001 3
1 4 4 1000001 4
2 1 1 1000001 1
2 2 2 1000001 2
2 3 3 1000001 3
2 4 4 1000001 4
..........................
5 5 5 1000001 4
When I try to use a lagged treatment variable, I get an error message:
e.g.
mim: xtreg fwork l.ratecata1, fe
-> _mj==1
-> xtreg fwork l.ratecata1, fe
not sorted
r(5);
Clearly, the data are not sorted properly, but I am unable to find the
proper sort order.
I am able run any lag command on the imputed datasets individually by
sorting like this:
sort idnum wave
but combining the results from each dataset is tedious and am hoping for
some insight on how to fix the problem.
thank you so much in advance,
Daniel Miller
Assistant Professor
Boston University School of Social Work
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/