lcc
Object.Diagnostic plots for conditional error and random effects from the linear mixed-effects fit are obtained. Six plots plots (selectable by 'which') are currently available: a plot of residuals against fitted values, a plot of residuals against time variable, a boxplot of residuals by subject, a plot of observerd values against fitted values, a normal Q-Q plot with simulation envelopes based on conditional error, and a normal Q-Q plot with simulation envelopes based on the random effects. By default, all plots are provided.
# S3 method for lcc
plot(x, which = c(1L:6L),
caption = list("Residuals vs Fitted",
"Residuals vs Time",
"Residuals by Subject",
"Observed values vs Fitted values",
"Normal Q-Q Plot (Conditional residuals)",
"Normal Q-Q Plot (Random effects)"),
sub.caption = NULL, main = NULL,
panel = if(add.smooth) panel.smooth else points,
add.smooth = TRUE, ask = TRUE,
id.n = 3, labels.id = names(residuals(x)),
label.pos = c(4, 2), cex.id = 0.75, cex.caption = 1,
cex.oma.man = 1.25, ...)
an object inheriting from class lcc
,
representing a fitted longitudinal concordance correlation
function.
if a subset of the plots is required, specify a subset of the numbers from 1 to 6.
captions to appear above the plots. Vector or list of
valid graphics annotations is required. All captions can be
supressed using '""' or NA
.
common sub-title (at bottom). Default to
NULL
.
The main title (on top) above the caption.
panel function. If add.smooth = TRUE
,
panel.smooth
is used rather than points
.
logical indicating if smoother should be added to
most plots; see also panel
above. Defaults to TRUE
.
logical; if TRUE
, the default, the user is _ask_ed
before each plot, see par
.
number of points to be labelled is the first three plots, starting with the most extreme.
vector of labels, from which the labels for extreme
points will be chosen. Default to NULL
(uses observation
numbers).
positioning of labels, for the left half and right half of the graph respectively, for plots 1-3.
magnification of point label.
controls the size of caption
.
controls the size of the sub.caption
only
if that is _above_ the figures when there is more than one.
further graphical parameters from 'par'.
The Q-Q plot uses the normalized residuals. The standardized residuals is pre-multiplied by the inverse square-root factor of the estimated error correlation matrix while the random effects is pre-multiplied by the inverse square root of the estimated variances obtained from matrix G. The simulate envelopes are obtained from package hnp (Moral et al., 2018).
Code partially adapted from plot.lm
.
# NOT RUN {
## Second degree polynomial model with random intercept, slope and
## quadratic term
fm1 <- lcc(data = hue, subject = "Fruit", resp = "H_mean",
method = "Method", time = "Time", qf = 2, qr = 2)
plot(fm1)
# }
Run the code above in your browser using DataCamp Workspace