Learn R Programming

MNB (version 1.2.0)

envelope.MNB: Simulation envelope

Description

Simulated envelopes in normal probability plots

Usage

envelope.MNB(star, formula, dataSet, n.r, nsim, plot = TRUE)

Value

L, residuals and simulation envelopes in normal probability plots

Arguments

star

Initial values for the parameters to be optimized over.

formula

The structure matrix of covariates of dimension n x p (in models that include an intercept x should contain a column of ones).

dataSet

data

n.r

Indicator which residual type graphics. 1 - weighted, 2 - Standardized weighted, 3 - Pearson, 4 - Standardized Pearson, 5 - standardized deviance component residuals and 6 - randomized quantile residuals.

nsim

Number of Monte Carlo replicates.

plot

TRUE or FALSE. Indicates if a graph should be plotted.

Author

Jalmar M F Carrasco <carrascojalmar@gmail.com>, Cristian M Villegas Lobos <master.villegas@gmail.com> and Lizandra C Fabio <lizandrafabio@gmail.com>

Details

Atkinson (1985), suggests the use of simulated envelopes in normal probability plots to facilitate the goodness of fit.

References

  • Atkinson A.C. (1985). Plots, Transformations and Regression: An Introduction to Graphical Methods of Diagnostic Regression Analysis. Oxford University Press, New York.

  • Fabio, L. C., Villegas, C., Carrasco, J. M. F., and de Castro, M. (2023). Diagnostic tools for a multivariate negative binomial model for fitting correlated data with overdispersion. Communications in Statistics - Theory and Methods, 52, 1833–1853.

  • Fabio, L. C., Villegas, C., Mamun, A. S., and Carrasco, J. M. F. (2025). Residual analysis for discrete correlated data in the multivariate approach. Brazilian Journal of Biometrics, 43, e43728.

Examples

Run this code

# \donttest{

data(seizures)
head(seizures)

star <-list(phi=1, beta0=1, beta1=1, beta2=1, beta3=1)

envelope.MNB(formula=Y ~ trt + period + trt:period +
offset(weeks),star=star,nsim=21,n.r=6,
dataSet=seizures,plot=FALSE)

data(alzheimer)
head(alzheimer)

star <- list(phi=10,beta1=2, beta2=0.2)
envelope.MNB(formula=Y ~ trat, star=star, nsim=21, n.r=6,
dataSet = alzheimer,plot=FALSE)

# }

Run the code above in your browser using DataLab