mcp.fnc: Model criticism plots.

Description Usage Arguments Details Value Author(s) References Examples

View source: R/mcp.fnc.R

Description

A function to graph criticism plots for an LMER model (as in Baayen, 2008, chapter 7). Note that this function cannot be used with generalized linear mixed-effects models (GLMERs). Also note that the fourth plot (dffits) is omitted until we can figure out how to calculate dffits for a merMod object.

Usage

1
mcp.fnc(model, trim = 2.5, col = "red")

Arguments

model

A mer object (fitted by function lmer). Note that, at the moment, this function cannot be used with generalized linear mixed-effects models (GLMERs).

trim

Used to plot lines in the fitted ~ standardized residuals plot. The lines correspond to the threshold at which residuals would be or were removed. Defaults to 2.5 (standard deviations above and below the residuals mean).

col

Color of the lines added to the quantile-quantile plot and fitted ~ standardized residuals plot. Defaults to red.

Details

The first of the four plots graphs the density of the model residuals. The second plot graphs the quantile-quantile plot (actual standardized residuals versus theoretical quantiles). The third plot illustrates the fitted values versus the standardized residuals. The fourth graph plots the absolute values of the dffits of the residuals (not producing this plot as of version 2.2; might come back in future versions).

Value

Returns the four plots described above.

Author(s)

Antoine Tremblay, Statistics Canada, trea26@gmail.com.

References

Baayen, R.H. (2008). Analyzing Linguistic Data. A Practical Introduction to Statistics Using R. Cambridge, UK: Cambridge University Press.

Examples

1
# see example LMERConvenienceFunctions help page.

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

LMERConvenienceFunctions documentation built on Oct. 23, 2020, 5:12 p.m.