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
How do i get R-sqaured from LS
Moderators: EViews Gareth, EViews Moderator
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Who is online
Users browsing this forum: No registered users and 1 guest
