model_pca: Plotting residuals using PCA

View source: R/model_pca.R

model_pcaR Documentation

Plotting residuals using PCA

Description

The function model_pca() plots several GAMLSS residuals using Principal Component Analysis.

Usage

model_pca(obj, ..., scale = TRUE, arrow_size = 1.5)

Arguments

obj

A gamlss object

...

for extra GAMLSS models

scale

whether to scale the residuals

arrow_size

the arrow sizw in the biplot

Details

The function model_pca() plot a biplot() plot of the residuals from different models. It uses Principal Component Analysis in the residuals of different models and plots the resuls.

Value

A biplot of the first two components is plotted.

Author(s)

Mikis Stasinopoulos, Bob Rigby and Fernanda De Bastiani

References

Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC. An older version can be found in https://www.gamlss.com/.

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, https://www.jstatsoft.org/v23/i07/.

Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC.

(see also https://www.gamlss.com/).

See Also

gamlss, resid_index

Examples

m1 <- gamlss(y~x, data=abdom)
m2 <- gamlss(y~pb(x), data=abdom)
m3 <- gamlss(y~pb(x), sigma.fo=~pb(x), data=abdom)
model_pca(m1,m2,m3)

gamlss.ggplots documentation built on Sept. 3, 2023, 5:08 p.m.