Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Rsq

R-square value of a fitted model


Description

Calculates the R^2 value for objects of class nls, lm, glm, drc or any other models from which fitted and residuals can be extracted. Since version 1.2-9 it calculates a weighted R^2 if the object has an item object$weights containing weighting values.

Usage

Rsq(object)

Arguments

object

a fitted model.

Details

Uses the most general definition of R^2:

R^2 \equiv 1 - \frac{RSS}{TSS}

where

RSS = ∑_{i=1}^{n}w_i \cdot (y_i-\hat{y}_i)^2

and

TSS = ∑_{i=1}^{n}w_i \cdot (y_i - \bar{y})^2

using the weighted mean

\bar{y} = \frac{∑_{i=1}^{n}w_ix_i}{∑_{i=1}^{n}w_i}

Value

The R^2 value of the fit.

Author(s)

Andrej-Nikolai Spiess

Examples

m1 <- pcrfit(reps, 1, 2, l5)
Rsq(m1)

qpcR

Modelling and Analysis of Real-Time PCR Data

v1.4-1
GPL (>= 2)
Authors
Andrej-Nikolai Spiess <a.spiess@uke.uni-hamburg.de>
Initial release
2018-05-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.