getting the standard error and p values.
Posted: Thu Aug 02, 2012 8:41 am
hi there!
I used the info here http://forums.eviews.com/viewtopic.php?f=5&t=1638 to make a small program.
The program runs a multiple regression and outputs the Rsquared in a vector and gets the coefficients in a matrix.
the first thing I would like to know is whether or not I can also get additional items such as the standard error, or even better the test statistics and the p values
that is my current output is:
Intercept
coefficient 1
coefficient 2
coefficient 3
coefficient 4
and in a separate file I get the R^2 in vector
What I would like to get is:
Intercept
coefficient 1
coefficient 2
coefficient 3
coefficient 4
R^2
Test statistic
Std Error
P value
my current code is:
'create vector to store r-squares
vector(61) r2
'create matrix to store coefficients. We'll be running 15 regressions (so 15 columns) with two coefficients in each, so two rows
matrix(5,61) coefs
'create empty equation to be used inside the loop
equation eq
''counter of how many equations we have run
!rowcounter=1
'run pairwise regressions between each series
for !i=1 to 61
'equation eq{!i}.ls x{!i} c mkt_rf smb hml mom
eq.ls x{!i} c mkt_rf hml smb mom
r2(!rowcounter) = eq.@r2
!rowcounter = !rowcounter+1
'store coefficients into matrix
colplace(coefs, eq.@coefs, !i)
next
I used the info here http://forums.eviews.com/viewtopic.php?f=5&t=1638 to make a small program.
The program runs a multiple regression and outputs the Rsquared in a vector and gets the coefficients in a matrix.
the first thing I would like to know is whether or not I can also get additional items such as the standard error, or even better the test statistics and the p values
that is my current output is:
Intercept
coefficient 1
coefficient 2
coefficient 3
coefficient 4
and in a separate file I get the R^2 in vector
What I would like to get is:
Intercept
coefficient 1
coefficient 2
coefficient 3
coefficient 4
R^2
Test statistic
Std Error
P value
my current code is:
'create vector to store r-squares
vector(61) r2
'create matrix to store coefficients. We'll be running 15 regressions (so 15 columns) with two coefficients in each, so two rows
matrix(5,61) coefs
'create empty equation to be used inside the loop
equation eq
''counter of how many equations we have run
!rowcounter=1
'run pairwise regressions between each series
for !i=1 to 61
'equation eq{!i}.ls x{!i} c mkt_rf smb hml mom
eq.ls x{!i} c mkt_rf hml smb mom
r2(!rowcounter) = eq.@r2
!rowcounter = !rowcounter+1
'store coefficients into matrix
colplace(coefs, eq.@coefs, !i)
next