Goodmorning
I have a panel data, with severall variables for each countriesin every years. However I have some missing values so I may want to subsitute them with the value of the mean (for each variables, and countries). Without using the loop the command would be
1)bysort countryname: egen AvgGDP=mean(GDP).
2)replace GDP=AvgGDP if GDP==.
My question is: is possible to automate this process using a loop?
I hope I was clear.
Thank you for your attention.
Related Posts with Problem to create loop
No standard errors reported for some variables when using xtlsdvcHello, I am trying to use xtlsdvc to correct for the bias in the dynamic panel model. However, I d…
ppmlhdfe and ppml provide different fitted valuesHello, I am running a gravity model thus from (Yotov2016) Code: ppml trade EXPORTER_TIME_FE* IMPORT…
Differents results depending order of independent variables in ANOVAHi all, I am having differents results in a Anova analysis depending order of independent variables…
Interpretation stata resultsHello, I'm doing a master thesis on the effect of CSR contracting on CSR performance. My model is b…
Gravity Equation for Trade | Merging panel datasetsHi all, I have a dataset from CEPII (gravdata.dta) which I have cleaned up to contain only specific…
Subscribe to:
Post Comments (Atom)
0 Response to Problem to create loop
Post a Comment