Creating Quartiles (Q1 and Q3)

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

Thomaaatke
Posts: 6
Joined: Sat Apr 29, 2017 2:24 pm

Creating Quartiles (Q1 and Q3)

Postby Thomaaatke » Fri May 12, 2017 10:17 am

Hi Everyone,


I try to delete the middle 50% of observations by only keeping the 25% lowest (Q1) and 25% highest (Q3) observations. I tried to make Quartiles by proc by classification but when I select 4 quartiles, i don't know how to delete the middel 50% oberservations. Is there an easy way to do this or do i have to use excel for this.

Thanks in advance,

Thomaaatke

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 11253
Joined: Tue Sep 16, 2008 5:38 pm

Re: Creating Quartiles (Q1 and Q3)

Postby EViews Gareth » Fri May 12, 2017 10:32 am

Not sure what you mean by "delete", but here's some code that NAs the middle out.

Code: Select all

Series y = @recode(x<@quantile(x,0.25) or x>@quantile(x,0.75), x, na)
Follow us on Twitter @IHSEViews

startz
Non-normality and collinearity are NOT problems!
Posts: 3115
Joined: Wed Sep 17, 2008 2:25 pm

Re: Creating Quartiles (Q1 and Q3)

Postby startz » Fri May 12, 2017 10:35 am

something like
smpl if y<quantile(y,.25) or y>@quantile(y,.75)

Thomaaatke
Posts: 6
Joined: Sat Apr 29, 2017 2:24 pm

Re: Creating Quartiles (Q1 and Q3)

Postby Thomaaatke » Tue May 16, 2017 4:09 am

Thanks a lot!


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: Bing [Bot] and 6 guests