Statalist


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

st: Aggregate and Microdata


From   Luis Bernardo Torres Ruiz <Luis.Torres@Colorado.EDU>
To   statalist@hsphsun2.harvard.edu
Subject   st: Aggregate and Microdata
Date   Mon, 18 May 2009 14:30:24 -0600 (MDT)

Dear Stata Users,

Im using a microdata set. Im estimating aggregates with the data set. The data set is unbalanced. A situation arises when I lag the variables by

sort  PLANT YEAR STATE COUNTY ECOGROUP FIRM
quietly by PLANT:  gen Ait1= aggregateprod[_n-1]

It generates missing values for the lag variable of the aggregate, but there should a value(with the exception of the first year), since Ait is the aggregate value by year. How can I change the missing values to the actual values without doing a replace for each year. I thank you in advance for all your help.

Sincerely,

Luis
*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index