Page 1 of 1

Smpl command

Posted: Sat Dec 27, 2014 6:13 am
by johnf
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.

Re: Smpl command

Posted: Sat Dec 27, 2014 8:59 am
by startz
Look carefully at the variables in your data set. Hint: what makes the second observation in each pair different from the first?

Re: Smpl command

Posted: Sat Dec 27, 2014 11:20 am
by johnf
Are you reffering to the even value of observation id? If yes, it occurred to me but don't know how to code it.

Re: Smpl command

Posted: Sat Dec 27, 2014 11:35 am
by startz
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.

Re: Smpl command

Posted: Sat Dec 27, 2014 1:34 pm
by johnf
Yeah, it worked. I entered "smpl 1 92 if year = 87"; the sample size (46) and coefficients now correspond.

Thanks. :D