Hi All,

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
But I feel there must be some option in the original command, or another command entirely that should make this simpler. Any suggestions?

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
graph: