GOF_check: Goodness of fit for GLMM

View source: R/gof_functions.R

GOF_checkR Documentation

Goodness of fit for GLMM

Description

Assessment of goodness of fit for GLMM

Usage

GOF_check(x, nsim = 100, alpha = 0.05)

Arguments

x

An object of clas iccc.

nsim

Number of simulations to run. Default is set to 100.

alpha

Level of significance

Details

Randomized quantile residuals are computed for the fitted model. Simulations based on the fitted model are generated and the model is refitted to each simulated dataset. Envelopes for RQR are built as the appropriate quantile (in relation to the level fo significance) of RQR from the refitted models. Additionally, a test for dispersion and zero inflation are carried out by comparing the RQR dispersion and the number of zeros from the original model and data to those from the refitted models and simulated data.

Value

An object of class GOF for which method plot is available. A list with the following components:

  • plot_env. Plot of RQR envelopes with the original RQR.

  • plot_var. Plot of the simulated RQR dispersion.

  • plot_zi. Plot of the count of zeros in the simulated datasets.

  • res_var. Dispersion of RQR from the original sample.

  • pval_var. Proportion of simulated RQR dispersion that are greater than the original dispersion that can be interpreted as a simulated P-value to check the goodness of fit on dispersion.

  • zero_count. Count of zeros in the original sample.

  • pval_zi. Proportion of simulated zero count that are greater than that of the original sample. It can be interpreted as a simulated P-value to check the hypothesis of zero-inflation.

See Also

plot.GOF(), DispersionTest(),ZeroTest()

Examples


# Poisson model. Repeatability setting.
iccpois<-icc_counts(EPP,y="Social",id="id")
GOF_check(iccpois)
# Zero-inflated Poisson model. Repeatability setting
icczip<-icc_counts(EPP,y="Social",id="id",fam="zip")
GOF_check(icczip)


iccCounts documentation built on May 29, 2024, 7:57 a.m.