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
Replace Values by previous valuesDear all, I am a bit stuck. I have household and personal id date for 8 rounds, however not each pe…
Interpretation of logistic regression of categorical variables with interactionGood morning! I am using a statewide dataset of adult inpatients with COVID-19 (n=18k+) to assess ra…
Necessary co-variate omitted due to collinearityHi everyone, I had a quick question. I am new to Stata, so please forgive me if this question seems…
Export adjusted ratios from dstdize commandDear all, Really appreciate if someone could kindly help me. I'm using Code: dstdize command to ca…
Retrieving data from online archive database and making it ready for STATA (CEDA Archive database) THERE MUST BE SOMEONE HERE WHO IS ABLE TO DO THIS Hi everyone, I'm in a bit of a pickle. I have …
Subscribe to:
Post Comments (Atom)
0 Response to Problem to create loop
Post a Comment