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?
Outliers
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Outliers
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
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)
?
genr assets = @recode (assets > @quantile (assets, .025) and assets < @quantile (assets, .975)
?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Outliers
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.
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
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
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
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Outliers
You'll have to just add more and statements to the sample.
Who is online
Users browsing this forum: No registered users and 2 guests
