Page 1 of 1

Reducing a sample

Posted: Thu Sep 28, 2017 7:45 pm
by mpsc19
I wonder how to reduce a sample to observe only individuals who appear in four quarters within four years. Im using Eviews 9.

Image

Re: Reducing a sample

Posted: Thu Sep 28, 2017 9:00 pm
by EViews Gareth
You'll have to define what you mean by "appear in four quarters in four years".

Re: Reducing a sample

Posted: Fri Sep 29, 2017 3:44 am
by mpsc19
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

Re: Reducing a sample

Posted: Fri Sep 29, 2017 5:16 am
by mpsc19
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

Re: Reducing a sample

Posted: Fri Sep 29, 2017 8:24 am
by EViews Gareth
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?

Re: Reducing a sample

Posted: Fri Sep 29, 2017 8:58 am
by mpsc19
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

Re: Reducing a sample

Posted: Fri Sep 29, 2017 10:07 am
by EViews Matt
Hello,

I believe the following accomplishes what you want:

Code: Select all

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

Re: Reducing a sample

Posted: Sat Sep 30, 2017 12:23 pm
by mpsc19
It works. Thanks!!