rSquared | R Documentation |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.