Description Usage Arguments Details Value Author(s) Examples
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.
1 | Rsq(object)
|
object |
a fitted model. |
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}
The R^2 value of the fit.
Andrej-Nikolai Spiess
1 2 |
Loading required package: MASS
Loading required package: minpack.lm
Loading required package: rgl
Loading required package: robustbase
Loading required package: Matrix
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE
3: .onUnload failed in unloadNamespace() for 'rgl', details:
call: fun(...)
error: object 'rgl_quit' not found
[1] 0.9997843
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.