| rsquared {heR.Misc} | R Documentation |
Calculate the coefficient of determination, commonly called the "r-squared" value, for a least squares linear fit of two variates
rsquared(ls.out)
ls.out |
the output object of a lsfit calculation |
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 |
A single value equal to the r-squared for a given linear least squares fit
Neil Klepeis