Dear all,
I want to supplement the current missing values using the values around it . Below is my code.
foreach x of varlist * {
qui bys id : replace `x'=`x'[_n-1] if missing(`x')
qui bys id : replace `x'=`x'[_n+1] if missing(`x')
}
but it seems not to work. Even I run this code a few times , there still exists missing value. Is there any command to do this job?
Related Posts with Missing values
EKC on STATAHello, I am comparing a linear, quadratic and cubic regression results of a Panel dataset. Those are…
Problem with Estpost and Esttab, exporting to LatexHello all, I am running some issues in exporting my tabulate result into Latex. my code is …
multiple regression - r(2000) error messageHi everyone, I am new here and quite new to Stata (student) so thank you upfront for your help. I …
Stata LoopsDear all, I have a long occupational dataset with several rows of observations for each person repr…
How can I estimate a pseudo-gravity equationHello everyone I a little bit new with Stata and now I am using the pseudo-gravity equation from the…
Subscribe to:
Post Comments (Atom)
0 Response to Missing values
Post a Comment