why the value is negative

For questions regarding programming in the EViews programming language.

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

tony
Posts: 59
Joined: Wed Jan 07, 2009 7:59 am

why the value is negative

Postby tony » Sun May 17, 2009 6:34 pm

Hi,all.I write a program,but the result seems to be unreasonable,plz help me correct it, thank you!
Here is the syntax:
!N=10000
workfile dfvalue u 1 !N
series lm
equation eq01
for !i=1 to !N
smpl 1 100
series u=@nrnd

series y
y(1)=0
smpl 2 100
y=y(-1)+u
eq01.ls d(y) y(-1)
smpl @all
lm(!i)=100*eq01.@r2
next
show lm.hist
matrix(2,8) cvalue
cvalue.fill(b=r)0.01,0.025, 0.05, 0.1, 0.9,0.95,0.975,0.99
!k=1
for %1 0.01 0.025 0.05 0.1 0.9 0.95 0.975 0.99
cvalue(2,!k)=@quantile(lm,%1)
!k=!k+1
next
show cvalue

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

Re: why the value is negative

Postby EViews Gareth » Sun May 17, 2009 6:49 pm

It would be useful if you were able to describe what it is the program does, and why you think the result is unreasonable.
Follow us on Twitter @IHSEViews

tony
Posts: 59
Joined: Wed Jan 07, 2009 7:59 am

Re: why the value is negative

Postby tony » Sun May 17, 2009 6:57 pm

this is a Lm test,and"lm(!i)=100*eq01.@r2" indicates that the cvalue are not negative,but the results do not.

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

Re: why the value is negative

Postby EViews Gareth » Sun May 17, 2009 8:13 pm

From that line it would appear that you are simply saving the R-Squareds from your equation.

Since there is no constant in your equation, there is nothing that says the R-Squared must be positive.
Follow us on Twitter @IHSEViews

tony
Posts: 59
Joined: Wed Jan 07, 2009 7:59 am

Re: why the value is negative

Postby tony » Sun May 17, 2009 9:11 pm

Exactly,you are right.
how can i obtian a positive Lm statistic value,do you have any idea,pls do me a favor.

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

Re: why the value is negative

Postby EViews Gareth » Sun May 17, 2009 9:23 pm

That's way to broad of a question for an answer.

That's a bit like asking "how can I make my coefficients significant?".
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 39 guests