R2: Calculate R2 Values

View source: R/models.R

R2R Documentation

Calculate R2 Values

Description

Generic function to return variance explained (R2) estimates from various models. In some cases these will be true R2 values, in other cases they may be pseudo-R2 values if R2 is not strictly defined for a model.

Usage

R2(object, ...)

## S3 method for class 'lm'
R2(object, ...)

Arguments

object

A fitted model object.

...

Additional arguments passed to specific methods.

Value

Depends on the method dispatch.

The raw and adjusted r-squared value.

Examples

R2(lm(mpg ~ qsec * hp, data = mtcars))

JWiley/JWileymisc documentation built on Feb. 15, 2024, 12:23 p.m.