I am currently working on my undergraduate dissertation, title "The Macroeconomic Determinants of Mental Health". I was advised by my supervisor to remove (or transform) the outliers of my "Inflation" variable. I watched a tutorial on YouTube to aid me with this, however it has not worked.
The code I used is:
Code:
ssc install winsor2 clonevar RealInflation=Inflation su RealInflation, d replace RealInflation=r(p99) if RealInflation>=r(p99) & RealInflation <. xtreg DepressionPrevM lnGDPpc Gini Unemp RealInflation FLaborforce GovExpE HealthExp i.Year, fe cluster(CountryNum) estimates store RMAllCountriesDY xtreg DepressionPrevM lnGDPpc Gini Unemp RealInflation FLaborforce GovExpE HealthExp i.Year if EconomicRegion2019=="L", fe cluster(CountryNum) estimates store RMLLMIncomeDY xtreg DepressionPrevM lnGDPpc Gini Unemp RealInflation FLaborforce GovExpE HealthExp i.Year if EconomicRegion2019=="M", fe cluster(CountryNum) estimates store RMUMIncomeDY xtreg DepressionPrevM lnGDPpc Gini Unemp RealInflation FLaborforce GovExpE HealthExp i.Year if EconomicRegion2019=="H", fe cluster(CountryNum) estimates store RMHIncomeDY estimates table RMAllCountriesDY RMLLMIncomeDY RMUMIncomeDY RMHIncomeDY, star(0.1 0.05 0.01) stats(N r2)
Is anyone able to see where I am going wrong with my code?
Thank you
0 Response to Removing outliers
Post a Comment