Learn R Programming

qpcR (version 1.3-7.1)

Rsq.ad: Adjusted R-square value of a fitted model

Description

Calculates the adjusted $R_{adj}^2$ value for objects of class nls, lm, glm, drc or any other models from which fitted, residuals and coef can be extracted.

Usage

Rsq.ad(object)

Arguments

object
a fitted model.

Value

  • The adjusted $R_{adj}^2$ value of the fit.

Details

$$R_{adj}^2 = 1 - \frac{n - 1}{n - p} \cdot (1 - R^2)$$ with $n$ = sample size, $p$ = number of parameters.

Examples

Run this code
## single model
m1 <- pcrfit(reps, 1, 2, l5)
Rsq.ad(m1)

## compare different models with increasing
## number of parameters
ml1 <- lapply(list(l3, l4, l5), function(x) pcrfit(reps, 1, 2, x))
sapply(ml1, function(x) Rsq.ad(x))

Run the code above in your browser using DataLab