Error with the command table_re en eviews

For questions regarding programming in the EViews programming language.

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

a.luna1941
Posts: 4
Joined: Mon Dec 21, 2015 6:06 am

Error with the command table_re en eviews

Postby a.luna1941 » Mon Dec 21, 2015 2:33 pm

Hi, my name is Alfonso,I'm doing my final thesis work. I'm doing a simulation error of measurement of variables to solve the problem of endogeneity, simulation is the Monte Carlo, I am creating the program and have a problem with the command table_re to run the program. I skip a error(said to be a non- legal or undeterminated).


Thank, Can somebody help me?

The program is this.
---------------------------------------------------

genr x= nrnd

table_re

_re(2,1)="var=0.1"
_re(3,1)="var=0.25"
_re(4,1)="var=0.5"
_re(5,1)="var=1"
_re(6,1)="var=2"
_re(7,1)="var=5"

_re(1,2)="Sesgo"

smpl 1 50
For !casos= 1 to 6

vector(100) beta0_{!casos}
vector(100) beta1_{!casos}

scalar V =varianzas(!casos)

For !i=1 to 100
genr u=nrnd
genr y=3+2*x+u

genr e=u+nrnd
genr x1=x+e*V^0.5

equation eq1.ls y c x1
beta0_{!casos}(!i)=c(1)
beta1_{!casos}(!i)=c(2)

next
_re(!casos+1,2)=@mean(beta1_{!casos})-2

next

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Error with the command table_re en eviews

Postby EViews Gareth » Mon Dec 21, 2015 2:39 pm

Other than the fact you don't have a space between "table" and "_re", I don't see anything particularly wrong with that code.

a.luna1941
Posts: 4
Joined: Mon Dec 21, 2015 6:06 am

Re: Error with the command table_re en eviews

Postby a.luna1941 » Tue Dec 22, 2015 3:10 am

Thank man, solve that problem, but I jump another error. This time it is with the variance scale. Says variances not defined in :equation: scale V = variance (1).

How do I solve it?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Error with the command table_re en eviews

Postby EViews Gareth » Tue Dec 22, 2015 9:46 am

You have a space.

a.luna1941
Posts: 4
Joined: Mon Dec 21, 2015 6:06 am

Re: Error with the command table_re en eviews

Postby a.luna1941 » Tue Dec 22, 2015 10:27 am

Continuing the problem. I corrected space. Error message(VARIANZAS is not defined in "SCALAR V=VARIANZAS(1)")

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Error with the command table_re en eviews

Postby EViews Gareth » Tue Dec 22, 2015 10:36 am

Do you have an object called VARIANZAS?

a.luna1941
Posts: 4
Joined: Mon Dec 21, 2015 6:06 am

Re: Error with the command table_re en eviews

Postby a.luna1941 » Tue Dec 22, 2015 11:51 am

Solve the problem man. The right to put, scalar v =(!Casos) and no variances.

genr x= nrnd table _re

_re(2,1)="var= 0.1"
_re(3,1)="var= 0.25"
_re(4,1)="var= 0.5"
_re(5,1)="var= 1"
_re(6,1)="var= 2"
_re(7,1)="var= 5"

_re(1,2)="Sesgo"

smpl 1 50
For !casos= 1 to 6

vector(100) beta0_{!casos}
vector(100) beta1_{!casos}

scalar v = (!casos)


For !i=1 to 100
genr u=nrnd
genr y=3+2*x+u

genr e=u+nrnd
genr x1=x+e*v^0.5

equation eq1.ls y c x1
beta0_{!casos}(!i)=c(1)
beta1_{!casos}(!i)=c(2)

next
_re(!casos+1,2)=@mean(beta1_{!casos})-2

next

Thank man.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests