Reducing a sample

For questions regarding programming in the EViews programming language.

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

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

Reducing a sample

Postby mpsc19 » Thu Sep 28, 2017 7:45 pm

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

Image

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

Re: Reducing a sample

Postby EViews Gareth » Thu Sep 28, 2017 9:00 pm

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

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

Re: Reducing a sample

Postby mpsc19 » Fri Sep 29, 2017 3:44 am

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: 26
Joined: Mon Jul 10, 2017 8:41 am

Re: Reducing a sample

Postby mpsc19 » Fri Sep 29, 2017 5:16 am

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: 13312
Joined: Tue Sep 16, 2008 5:38 pm

Re: Reducing a sample

Postby EViews Gareth » Fri Sep 29, 2017 8:24 am

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: 26
Joined: Mon Jul 10, 2017 8:41 am

Re: Reducing a sample

Postby mpsc19 » Fri Sep 29, 2017 8:58 am

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: 562
Joined: Thu Apr 25, 2013 7:48 pm

Re: Reducing a sample

Postby EViews Matt » Fri Sep 29, 2017 10:07 am

Hello,

I believe the following accomplishes what you want:

Code: Select all

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

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

Re: Reducing a sample

Postby mpsc19 » Sat Sep 30, 2017 12:23 pm

It works. Thanks!!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 16 guests