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 :)
Sample Distributions
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: Sample Distributions
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 @allWho is online
Users browsing this forum: No registered users and 2 guests
