rsquared {heR.Misc}R Documentation

Coefficient of Determination (R-Squared)

Description

Calculate the coefficient of determination, commonly called the "r-squared" value, for a least squares linear fit of two variates

Usage

rsquared(ls.out)

Arguments

ls.out the output object of a lsfit calculation

Details

This function was adapted from the ls.print function.

This function takes the output from an lsfit run and returns the r-squared value, which is typically used as an indication of how much variation in the response (dependent) variable, y, is "explained" by the key (independent) variable, x. The r-squared statistic is formally referred to as the coefficient of determination. Given two matched data vectors x and y, it is the proportion of variation in the reponse, y, that can be attibuted to an approximate linear relationship between x and y.

The ceofficient of variation, r-squared, is defined as follows:
SSresid = the residual sum of squares
SStotal = the total sum of squares
r-squared = 1 - SSresid/SSTotal

Value

A single value equal to the r-squared for a given linear least squares fit

Author(s)

Neil Klepeis


[Package heR.Misc version 0.0.4 Index]