binom.diagnostics: Diagnostics for Binary GLM
Description
Two techniques for evaluating the adequacy of the binary glm model used in mlcm
, based on code in Wood (2006).Usage
binom.diagnostics(obj, nsim = 200, type = "deviance")## S3 method for class 'mlcm.diag':
plot(x, alpha = 0.025, breaks = "Sturges", ...)
Value
binom.diagnostics
returns a list of class mlcm.diag with components- NumRunsinteger vector giving the number of runs obtained for each simulation
- residnumeric matrix giving the sorted deviance residuals in each column from each simulation
- Obs.residnumeric vector of the sorted observed deviance residuals
- ObsRunsinteger giving the observed number of runs in the sorted deviance residuals
- pnumeric giving the proportion of runs in the simulation less than the observed value.
Details
Wood (2006) describes two diagnostics of the adequacy of a binary glm model based on analyses of residuals (see, p. 115, Exercise 2 and his solution on pp 346-347). The first one compares the empirical cdf of the deviance residuals to a bootstrapped confidence envelope of the curve. The second examines the number of runs in the sorted residuals with those expected on the basis of independence in the residuals, again using a resampling based on the models fitted values. The plot method generates two graphs, the first being the empirical cdf and the envelope. The second is a histogram of the number of runs from the bootstrap procedure with the observed number indicated by a vertical line. Currently, this only works if the glm method is used to perform the fit and not the optim methodReferences
Wood, SN Generalized Additive Models: An Introduction with R, Chapman & Hall/CRC, 2006 Ho, Y. H., Landy. M. S. and Maloney, L. T. (2008). Conjoint measurement of gloss and surface texture. Psychological Science, 19, 196--204.
Examples
Run this codedata(BumpyGlossy)
bg.mlcm <- mlcm(BumpyGlossy)
bg.diag <- binom.diagnostics(bg.mlcm)
plot(bg.diag)
Run the code above in your browser using DataLab