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
Hurdle model with nehurdle command in Stata 12I am using nehurdle command in Stata 12. My dependent variable is education expenditure (consisting …
Elasticity estimates in Tobit regressionDear Statalisters This is my first post so please excuse if the question is not posed correctly. W…
hcost: error occurred while loading hcost.adoGood day all, i need to run a hcost command to calculate cost estimate based on censored data [http…
year dummies in xtreg and pooled OLSHello, I ran both a fixed effects model and pooled OLS model on the same dataset. I am now wonderin…
serial/cross sectional autocorrelation and heteroscedasticity in panel dataHello everyone, I am working with a paneldataset with N=170 and T=5. I want to test for heterosceda…
Subscribe to:
Post Comments (Atom)
0 Response to Missing values
Post a Comment