Learn R Programming

INDperform (version 0.2.2)

cooks_dist_gamm: Calculates the Cook`s distance for Generalized Additive Mixed Models (GAMM)

Description

cooks_dist_gamm is a helper function for model_gamm and plot_diagnostics and calculates the Cook`s distance for objects of class `gamm`. The Cook`s distance D is a leave-one-out deletion diagnostics to measure the influence of each observation. The generic cooks.distance function does not work on the class `gamm`.

Usage

cooks_dist_gamm(gamm_model)

Arguments

gamm_model

The <U+2018>gam<U+2018> sublist from a model object of class gamm.

Value

The function returns a numerical vector of the same length then the data used for the GAMM fitting, with one D value for each IND observation.

See Also

plot_diagnostics, model_gamm

Examples

Run this code
# NOT RUN {
# Using a model of the Baltic Sea demo data
cooks_dist_gamm(gamm_model = model_gamm_ex$model[[49]]$gam)
# }

Run the code above in your browser using DataLab