Learn R Programming

gamlss.ggplots (version 2.1-12)

model_pca: 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)

Value

A biplot of the first two components is plotted.

Arguments

obj

A gamlss object

...

for extra GAMLSS models

scale

whether to scale the residuals

arrow_size

the arrow sizw in the biplot

Author

Mikis Stasinopoulos, Bob Rigby and Fernanda De Bastiani

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.

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.

Stasinopoulos, M.D., Kneib, T., Klein, N., Mayr, A. and Heller, G.Z., (2024). Generalized Additive Models for Location, Scale and Shape: A Distributional Regression Approach, with Applications (Vol. 56). Cambridge University Press.

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

See Also

gamlss, resid_index

Examples

Run this code
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)

Run the code above in your browser using DataLab