Learn R Programming

SMIR (version 0.02)

R2: Coefficient of determination of linear models

Description

This function provides the coefficient of determination for lm objects that may not have an intercept

Usage

R2(model)

Arguments

model
an object as returned by 'lm'

References

Aitkin, M., Francis, B., Hinde, J. and Darnell, R. (2009). Statistical Modelling in R, UOP.

Examples

Run this code
data(trees)
R2(lm(v ~ d + h - 1, data=trees))

Run the code above in your browser using DataLab