Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Panel data: how to deal with varbles existing in 98 but notin 99


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

To me at least, the author seems to mean "variables" rather than "observations." Since she states that questions were asked at one wave, but not at the others. Her example, religion, is often presumed to be time invariant (i.e. people don't change their religions often), so it would make sense that it would only be asked at one point. It might be useful to know whether the "problem" variables are all of this sort or not.
Rose

Nick Cox wrote:


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 you
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.

Nirina M.


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