Learn R Programming

gamlss (version 4.2-4)

Rsq: Generalised R-squared for GAMLSS models

Description

This function gives the generalised R-squared of Nagelkerke (1991) for a GAMLSS model

Usage

Rsq(object)

Arguments

object
a GAMLSS object

Value

  • A single value

Details

This uses the generalised definition for R-squared defined as $$R^2=1- \left(\frac{L(0)}{L(\hat{\theta})}\right)^(2/n)$$ where $L(0)$ is the null model (only a constant is fitted to all parameters) and $L(\hat{\theta})$ is the current fitted model.

References

Nagelkerke, N. J. (1991). A note on a general definition of the coefficient of determination. Biometrika, 78(3), 691-692. Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, http://www.jstatsoft.org/v23/i07.

See Also

GAIC

Examples

Run this code
data(aids)
m1 <- gamlss(y~x+qrt, data=aids, family=NBI)
Rsq(m1)
rm(m1)

Run the code above in your browser using DataLab