Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rSquared

Calculate R squared value


Description

Calculate R squared value.

Usage

rSquared( y, resid )

Arguments

y

vector of endogenous variables

resid

vector of residuals

Author(s)

Arne Henningsen

Examples

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

miscTools

Miscellaneous Tools and Utilities

v0.6-26
GPL (>= 2)
Authors
Arne Henningsen, Ott Toomet
Initial release
2019-12-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.