Smpl command

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

johnf
Posts: 9
Joined: Fri Dec 26, 2014 7:36 am

Smpl command

Postby johnf » Sat Dec 27, 2014 6:13 am

Hi,

How to select every second observation value (starting from the second observation) from the sample to be included in the equation estimation?

I know that @first+1 excludes first value but I don't know how then to include every second value till the last one.

Thanks.

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

Re: Smpl command

Postby startz » Sat Dec 27, 2014 8:59 am

Look carefully at the variables in your data set. Hint: what makes the second observation in each pair different from the first?

johnf
Posts: 9
Joined: Fri Dec 26, 2014 7:36 am

Re: Smpl command

Postby johnf » Sat Dec 27, 2014 11:20 am

Are you reffering to the even value of observation id? If yes, it occurred to me but don't know how to code it.

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

Re: Smpl command

Postby startz » Sat Dec 27, 2014 11:35 am

I think if you look at all the variables, you will find that one contains the year of the observation or is a dummy for the year. You can then use smpl if to only include those observations that you want.

johnf
Posts: 9
Joined: Fri Dec 26, 2014 7:36 am

Re: Smpl command

Postby johnf » Sat Dec 27, 2014 1:34 pm

Yeah, it worked. I entered "smpl 1 92 if year = 87"; the sample size (46) and coefficients now correspond.

Thanks. :D


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests