Page 1 of 1

Deciles

Posted: Thu Oct 23, 2008 11:31 am
by fhnickel
I have series that contains "na"s and I am looking to find what decile each observation falls into. The series undated. Any help would be appreciated

Re: Deciles

Posted: Thu Oct 23, 2008 11:52 am
by EViews Gareth
Something along the lines of this should work.

Code: Select all

series quantiles
for !i=10 to 1 step -1
smpl if x<@quantile(x,!i/10)
quantiles = !i
next
smpl @all

Re: Deciles

Posted: Thu Oct 23, 2008 3:10 pm
by EViews Glenn
I have series that contains "na"s and I am looking to find what decile each observation falls into. The series undated. Any help would be appreciated


Here's an easier method...use the series "Proc/Generate by Classification". Choose Method = "Quantile Values" and enter "10" as your number of quantiles. We'll create a new series containing the quantiles.

By default we will apply a value map to the resulting output series so that you'll see the ranges for the quantile bins in the default display, but the underlying quantile numbers are there in the series. You can either delete the Valmap specification from the procedure, or turn off the display of the valmap in the resulting series by selecing "Raw data" in the combo in the series toolbar.