Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: lags with multiply imputed panel data

From   Daniel Miller <>
Subject   st: lags with multiply imputed panel data
Date   Sun, 28 Feb 2010 13:51:53 -0500

Hello all ---- I had posted this once already with no replies, and thought I
would give it one more shot:

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:

mim: xtreg fwork l.ratecata1, fe
-> _mj==1
-> xtreg fwork l.ratecata1, fe
not sorted

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:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index