rSquared: Calculate R squared value

View source: R/utils.R

rSquaredR Documentation

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 documentation built on May 3, 2023, 5:11 p.m.