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
Margins after xtlogit, feDear Statalist: I am trying to verify something about the -margins- command after xtlogit, fe. When…
two fpfit plots on one with estoptsHello stata-users, I have tried plotting two fpfit curves on one graph using Code: twoway (fpfit v…
Difference in annual hour worked between migrant and native married women by years since migration: a graphical illustration of assimilationDear Statalist, I posted a similar question before, but I think I am a bit closer now where I might…
Xtabond2: Using the nolevel command when one variable is already differenced AND divided by a value from last period.Hey all, I am currently using xtabond2 for my small T large N panel data estimation. My variables …
Long to wide, converting values to label for new variableHi all, I've got a raw dataset in the following format: indicatorcode indicatordescription regi…
Subscribe to:
Post Comments (Atom)
0 Response to Problem to create loop
Post a Comment