Page 1 of 1

why the value is negative

Posted: Sun May 17, 2009 6:34 pm
by tony
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

Re: why the value is negative

Posted: Sun May 17, 2009 6:49 pm
by EViews Gareth
It would be useful if you were able to describe what it is the program does, and why you think the result is unreasonable.

Re: why the value is negative

Posted: Sun May 17, 2009 6:57 pm
by tony
this is a Lm test,and"lm(!i)=100*eq01.@r2" indicates that the cvalue are not negative,but the results do not.

Re: why the value is negative

Posted: Sun May 17, 2009 8:13 pm
by EViews Gareth
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.

Re: why the value is negative

Posted: Sun May 17, 2009 9:11 pm
by tony
Exactly,you are right.
how can i obtian a positive Lm statistic value,do you have any idea,pls do me a favor.

Re: why the value is negative

Posted: Sun May 17, 2009 9:23 pm
by EViews Gareth
That's way to broad of a question for an answer.

That's a bit like asking "how can I make my coefficients significant?".