How to report P value of a rolling regression in a table
Posted: Thu Dec 03, 2015 8:14 am
Hi,
I am not able to report P-value of a rolling regression in the table.
Could anyone please help where I am doing wrong in the code?
I would be very thankful to you.
Below is the Code for the reference:
if @isobject("comparison") then
delete comparison
endif
'create vector to store r-squares
matrix(6,64) comparison
'create empty equation to be used inside the loop
equation eq
%smpl_start="2000Q3"
%smpl_end="2015Q2"
smpl {%smpl_start} {%smpl_end} '@last
'get size
!length = @obssmpl
!j=1
for !i = 0 to !length step 1
!j=!j+1
'smpl 1996q1+!i 1996q1+8+!i
smpl {%smpl_start} {%smpl_start}+!i+30
eq.ls 'Put your Model equation here
'store coefficients into matrix
comparison = @tdist(eq.@tstat(2), eq.@regobs - eq.@ncoefs)
next
I am not able to report P-value of a rolling regression in the table.
Could anyone please help where I am doing wrong in the code?
I would be very thankful to you.
Below is the Code for the reference:
if @isobject("comparison") then
delete comparison
endif
'create vector to store r-squares
matrix(6,64) comparison
'create empty equation to be used inside the loop
equation eq
%smpl_start="2000Q3"
%smpl_end="2015Q2"
smpl {%smpl_start} {%smpl_end} '@last
'get size
!length = @obssmpl
!j=1
for !i = 0 to !length step 1
!j=!j+1
'smpl 1996q1+!i 1996q1+8+!i
smpl {%smpl_start} {%smpl_start}+!i+30
eq.ls 'Put your Model equation here
'store coefficients into matrix
comparison = @tdist(eq.@tstat(2), eq.@regobs - eq.@ncoefs)
next