Sample Distributions

For questions regarding programming in the EViews programming language.

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

shawn19900217
Posts: 1
Joined: Thu Feb 09, 2012 11:09 pm

Sample Distributions

Postby shawn19900217 » Thu Feb 09, 2012 11:19 pm

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 :)

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Sample Distributions

Postby trubador » Fri Feb 10, 2012 1:39 am

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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests