getting the standard error and p values.

For questions regarding programming in the EViews programming language.

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

a_papageorgiou
Posts: 3
Joined: Mon Jul 30, 2012 5:07 pm

getting the standard error and p values.

Postby a_papageorgiou » Thu Aug 02, 2012 8:41 am

hi there!
I used the info here 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

a_papageorgiou
Posts: 3
Joined: Mon Jul 30, 2012 5:07 pm

Re: getting the standard error and p values.

Postby a_papageorgiou » Thu Aug 02, 2012 8:43 am

one more comment!
Is it possible to get adjusted r squared instead of simple r squared???

Thank you in advance for your time!!

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: getting the standard error and p values.

Postby startz » Thu Aug 02, 2012 8:45 am

Look in help under equation, data members. You'll find a list of everything available.

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: getting the standard error and p values.

Postby EViews Esther » Thu Aug 02, 2012 8:57 am

Code: Select all

'....
eq.ls x{!i} c mkt_rf hml smb mom
r2(!rowcounter) = eq.@r2 'r-squares
rbar2(!rowcounter) = eq.@rbar2 'adjusted r-squares
!rowcounter = !rowcounter+1

colplace(coefs, eq.@coefs, !i)
colplace(stderrs, eq.@stderrs, !i) 'std errs
colpace(tstats, e1.@tstats, !i) 'test-stat

Please see Page 34-35 of EViews 7 Object Ref.

a_papageorgiou
Posts: 3
Joined: Mon Jul 30, 2012 5:07 pm

Re: getting the standard error and p values.

Postby a_papageorgiou » Thu Aug 02, 2012 9:26 am

Thank you for the help!This is exactly what I needed! Will know know to look in object reference!
Cheers!

abhay16dec
Posts: 3
Joined: Wed Nov 21, 2018 5:52 am

Re: getting the standard error and p values.

Postby abhay16dec » Mon Jul 01, 2019 5:18 am

Hi,
I want to know that how to save the standard errors of a forecast variables.
e.g. I'm running this equation
equation eq_temp5950V5.ls log(1+degCelsious_wrd) = c(1)+c(2)*log(CO2_riv19)
eq_temp5950V5.forecast degCelsious_wrdf5950 'saving the forecast variable

similar to forecast variable I want to save its corresponding standard errors (to save and plot for future analysis)
What is the command for saving standard errors?

Reagards,

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

Re: getting the standard error and p values.

Postby EViews Gareth » Mon Jul 01, 2019 8:08 am

Add a second name to the forecast proc.

http://www.eviews.com/help/helpintro.ht ... 23ww176268
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: Google [Bot] and 25 guests