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"
Summarizing special character of string variable*Is there any command by which I can summarize special characters (e.g. *,-.) of string variable? …
Ereturn Scalar on MI Estimate?Hi All, I currently am trying to perform a bootstrap on mi estimate: logistic. However, when I run …
PCA vs MCA for index with survey weightsDear All, I am trying to calculate a wealth index using Principal Component Analysis. The quintiles…
Observations in descriptive and multivariate analysesHi, I am just writing to ask something about the observations in descriptive and multivariate analys…
2x2 AB/BA crossover trial analysis resources/adviceHi all. I would like to conduct the analysis of a trial comparing two drugs (A and B) on reducing p…
Subscribe to:
Post Comments (Atom)
0 Response to Filling a number of missing variables sharing prefix with "replace"
Post a Comment