Calculate R squared value
Calculate R squared value.
rSquared( y, resid )
y |
vector of endogenous variables |
resid |
vector of residuals |
Arne Henningsen
data( "Electricity", package = "Ecdat" ) reg <- lm( cost ~ q + pl + pk + pf, Electricity ) rSquared( Electricity$cost, reg$residuals ) summary( reg )$r.squared # returns the same value
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.