From | Rose Medeiros <[email protected]> |
To | [email protected] |
Subject | Re: st: Panel data: how to deal with varbles existing in 98 but notin 99 |
Date | Tue, 06 Dec 2005 14:06:19 -0500 |
This answer takes Nirina to mean "observations"
when she says "variables". I did wonder this myself, but it is not what she said.
Nick [email protected]
Stas Kolenikov
Depends on what you want to do with them. You can -drop- them, or youNirina M.
can fill them in by
sort panelid time
unab allvars : *
foreach x in varlist `allvars' {
bysort panelid (time): replace x=x[_n-1] if mi(x)
}
This may lead to some awkward results, and sometimes the missing value
is a valid one (e.g. a wage of somebody who was employed in the first
period, but not in the second one), so if you know the variables you
want to fill in by the prior values, you should put them as the
varlist in -foreach- above.
*my question should be very easy but forgive my
d..ness.
I am creating a panel data but the trouble now is that
there are variables that exist in the start of the
survey but does not exist in the following year:(or
sometimes new questions come up in the following year
but were not asked before): say the religion, they ask
it in 98 but not later.
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
* * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |