Page 1 of 1
Outliers
Posted: Wed Jun 17, 2009 4:40 am
by jessisam
How do I remove outliers form a group of data? I would like to remove the 2,5 % lowest and 2,5 % highest observations within this datagroup and make a new group out of this data without the outliers. I have tried this quote, but it doesn't work:
genr assets= @recode ( assets > @quantile ( assets, 0.025) or assets < 0.975)
Is there a quote to do this?
Re: Outliers
Posted: Wed Jun 17, 2009 7:33 am
by startz
How do I remove outliers form a group of data? I would like to remove the 2,5 % lowest and 2,5 % highest observations within this datagroup and make a new group out of this data without the outliers. I have tried this quote, but it doesn't work:
genr assets= @recode ( assets > @quantile ( assets, 0.025) or assets < 0.975)
Is there a quote to do this?
Code: Select all
smpl if assets > @quantile( assets, 0.025) or assets <@quantile( assets, 0.975)
Re: Outliers
Posted: Wed Jun 17, 2009 9:31 am
by jessisam
So there isn't a way to generate a new group without the outliers? The reason I ask is because I first want to remove the outliers and then divide the data set into 4 quantiles and see the descriptive statistics of this. Isn't there a quote like this that removes outliers:
genr assets = @recode (assets > @quantile (assets, .025) and assets < @quantile (assets, .975)
?
Re: Outliers
Posted: Wed Jun 17, 2009 10:04 am
by EViews Gareth
First off I believe there is a mistake in Startz's code - the OR should be an AND.
Secondly, yes you can create a series like that:
series test = @recode(assets > @quantile( assets, 0.025) and assets <@quantile( assets, 0.975), assets, na)
Thirdly, if all you want is descriptive statistics, you could use Startz's approach and set the sample, then calculate the statistics.
Re: Outliers
Posted: Sat Feb 21, 2015 11:19 am
by diggetybo
I have a follow up question,
How can we specify the sample to impose the quantile restrictions on all variables?
smpl if assets > @quantile( assets, 0.025) and assets <@quantile( assets, 0.975)
The above case is only for the series "assets"
Please advise,
Thanks
Re: Outliers
Posted: Sat Feb 21, 2015 11:58 am
by EViews Gareth
You'll have to just add more and statements to the sample.