How do i get R-sqaured from LS

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

jjussa
Posts: 8
Joined: Wed Apr 20, 2011 3:30 pm

How do i get R-sqaured from LS

Postby jjussa » Thu Jul 28, 2011 7:13 am

my code is below...its a cross sectional regression run every month for a period of 20 years. How do i obtain the Rsquared values for each regression and store them in a matrix. Currently I am able to obtain the beta coefficients and tstats but I am unsure how to obtain the rsquared. thanks in advance for your help.

' from period 2 till the end period
for !t = 2 to !end-!predict_period ' the minus 3 is there because earnings are predicted for the next year
smpl @all if PERIOD_ID=!t
' setup the equation and perform regression
equation TEMP_EQU.ls NEXT_E c E NEGE ACC_NEG ACC_POS AG DD DIV BM PRICE
' get residuals
TEMP_EQU.makeresids TEMP_RESID
' store coefficents
!print_end=TEMP_EQU.@ncoef
for !j=1 to !print_end
acoef(!t,!j) = TEMP_EQU.@coefs(!j)
atstat(!t,!j) =TEMP_EQU.@tstats(!j)
next
EC_RESID = TEMP_RESID
delete TEMP_EQU TEMP_RESID
smpl @all
' next
next

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

Re: How do i get R-sqaured from LS

Postby EViews Gareth » Thu Jul 28, 2011 7:44 am

@r2


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 1 guest