Hi Statalisters,
I've merged two datasets which are cross-sectional(year of 2004) and time series(year from 2012-2015) with student id.
Because the variables from those two are different, I should fill the missing values in the rest 4 years with the number in year 2004.
Searching Statalist, I found the following code to fill the BYAID for 2012-2015 with 2004.
bysort BYSID (BYAID) : replace BYAID = BYAID[_n-1] if missing(BYAID)
However, there are a bunch of other variables starting with BYA#, BYT#, FY#... (# means series of numbers).
I've tried with the following code,
bysort BYSID (BYA*) : replace BYA* = BYA*[_n-1] if missing(BYA*)
But there was error message : BYA ambiguous abbreviation
How could I fill all the missing variable with these prefix, without error??
Related Posts with Filling a number of missing variables sharing prefix with "replace"
Margins with tobit for elasticity estimatesI am running a tobit regression to model education expenditures (zero forsome households) and tried …
How to obtain confidence interval & p-value from stmh command result tableGood Morning, I am a relatively new STATA15 user. I need some help obtaining the confidence interva…
Post estimation command for predicted count probabilities of count models (NB)After estimating a Negative Binomial model, I need to obtain predicted count probabilities of specif…
Computations within groupHello friends, I have a data like the following: Year Firm Gender 2009 A M 2009 A M 2009 A …
Dealing with missing valuesHi, I am using an individual survey and I am examining the impact of international remittances on ch…
Subscribe to:
Post Comments (Atom)
0 Response to Filling a number of missing variables sharing prefix with "replace"
Post a Comment