I'm trying to create a new variable that assigns each observation to a percentile within my continuous variable 'gdp_continuous' (dataex below). However, gdp_continuous has a striking outlier (see graph).
Is there a way I can use the xtile command while suppressing the outlying value of gdp_continuous? So far, I've come up with an extremely annoying workaround (with 174150 being the value of the 3 outlying obs), namely
Code:
gen gdp_continuous = gdp_crutch replace gdp_crutch=. if gdp_continuous == 174150 xtile gdp = gdp_crutch, nq(4) replace gdp = 5 if gdp_continuous == 174150
dataex
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float gdp_continuous 71086 71086 71086 71086 71086 39201 39201 39201 39201 39201 39201 39201 38303 38303 38303 38303 38303 38303 41643 41643 41643 41643 41643 41643 41643 41643 41643 41643 41643 41643 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 63785 end
0 Response to Using xtile while suppressing an outlier value
Post a Comment