## Reducing a sample

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

mpsc19
Posts: 24
Joined: Mon Jul 10, 2017 8:41 am

### Reducing a sample

I wonder how to reduce a sample to observe only individuals who appear in four quarters within four years. Im using Eviews 9.

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

### Re: Reducing a sample

You'll have to define what you mean by "appear in four quarters in four years".
Follow us on Twitter @IHSEViews

mpsc19
Posts: 24
Joined: Mon Jul 10, 2017 8:41 am

### Re: Reducing a sample

I am working with quarters, I have twenty quarters and the same individual appear in one, two, three or four quarters maximum. I want to observe only those who appear in four quarters since I am not interested in individuals who appear in less

mpsc19
Posts: 24
Joined: Mon Jul 10, 2017 8:41 am

### Re: Reducing a sample

I was looking at how I could do dummy variables that would throw me 1 if that individual is in four quarters and 0 if he is not in four quarters. or I do not know what else can be done

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

### Re: Reducing a sample

Still not clear. If you have 20 quarters - that's 5 years, yet you said 4 years?

And you want individuals that have any four quarters, or four consecutive?

Also, what's an individual?
Follow us on Twitter @IHSEViews

mpsc19
Posts: 24
Joined: Mon Jul 10, 2017 8:41 am

### Re: Reducing a sample

EViews Gareth wrote:Still not clear. If you have 20 quarters - that's 5 years, yet you said 4 years?

And you want individuals that have any four quarters, or four consecutive?

Also, what's an individual?

Yes, I got confused, it's 5 years.
I want individuals that have any four quarters.
The individuals are the surveyed households, which in the photo are shown in the variable "a5" where a code is designated for each household. sorry but I dont speak English and I dont handle the eviews well

EViews Matt
EViews Developer
Posts: 314
Joined: Thu Apr 25, 2013 7:48 pm

### Re: Reducing a sample

Hello,

I believe the following accomplishes what you want:

Code: Select all

`smpl if @obsby(cellid, a5, "if cellid = 1") >= 4`

mpsc19
Posts: 24
Joined: Mon Jul 10, 2017 8:41 am

### Re: Reducing a sample

It works. Thanks!!

Return to “Programming”

### Who is online

Users browsing this forum: No registered users and 8 guests