Learn R Programming

robustlmm (version 3.3-1)

plot.rlmerMod: Plot Method for "rlmerMod" objects.

Description

Diagnostic plots for objects of class rlmerMod and lmerMod.

Usage

# S3 method for rlmerMod
plot(
  x,
  y = NULL,
  which = 1:4,
  title = c("Fitted Values vs. Residuals", "Normal Q-Q vs. Residuals",
    "Normal Q-Q vs. Random Effects", "Scatterplot of Random Effects for Group \"%s\""),
  multiply.weights = FALSE,
  add.line = c("above", "below", "none"),
  ...
)

# S3 method for rlmerMod_plots print(x, ask = interactive() & length(x) > 1, ...)

Value

a list of plots of class ggplot that can be used for further modification before plotting (using print).

Arguments

x

an object as created by rlmer or rlmer; or an object as created by plot.rlmerMod

y

currently ignored.

which

integer number between 1 and 4 to specify which plot is desired.

title

Titles for the different plots. The fourth item can be a format string passed to sprintf to add the name of the current group.

multiply.weights

multiply the residuals / random effects with the robustness weights when producing the Q-Q plots.

add.line

add reference line to plots, use "above" or "below" to show the line above or below the points. Hide the line with "none".

...

passed on to geom_hline and geom_qq_line, to customize how the line is drawn.

ask

waits for user input before displaying each plot.

Details

The robustness weights for estimating the fixed and random effects are used in the plots, e.g., the ones returned by getME(object, "w_e") and getME(object, "w_b").

See Also

getME, ggplot

Examples

Run this code
if (FALSE) {
  rfm <- rlmer(Yield ~ (1|Batch), Dyestuff)
  plot(rfm)
  fm <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
  plot.rlmerMod(fm)
}

Run the code above in your browser using DataLab