Statalist


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

Re: st: Getting data from NBER to STATA


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: Getting data from NBER to STATA
Date   Thu, 21 May 2009 12:25:26 -0400

Forgot to say --
then drop the extra observations (last line below)!

... note the extra step for CPS files after infiling is to -replace-
household and family record variables with something like:

unab x: hrecord-frecord
loc x: subinstr local x "frecord" "", all
loc x: subinstr local x "hrecord" "", all
qui foreach v of local x {
 replace `v'=`v'[_n-1] if hrecord>1
}
unab x: frecord-precord
loc x: subinstr local x "precord" "", all
loc x: subinstr local x "frecord" "", all
qui foreach v of local x {
 replace `v'=`v'[_n-1] if hrecord==3
}
keep if hrecord==3
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index