why the value is negative
Posted: 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
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