Page 1 of 1

Sample Distributions

Posted: Thu Feb 09, 2012 11:19 pm
by shawn19900217
Hello,

I was asked to take 200 samples of 5 observations from 1000 observations and run regression with OLS method.
(observation 1-5, 6-10, and so forth.)

I entered the following but they tell me "i" is not defined. Can someone tell me what I did wrong here?

vector(200) beta
for !i=1 to 200
smpl (!i-1)*5+1 !i*5
ls y=c(1) +c(2)*x
beta(!i)=@coefs(2)
next


Any help is appreciated.
Thanks in advance :)

Re: Sample Distributions

Posted: Fri Feb 10, 2012 1:39 am
by trubador
Nothing seems wrong with your control variable. However, the following version would be more effective:

Code: Select all

vector(200) beta for !i=1 to 200 !beg = (!i-1)*5+1 !end = !i*5 smpl !beg !end equation eq.ls y=c(1) +c(2)*x beta(!i)=@coefs(2) next smpl @all