lcc ObjectGenerates a series of diagnostic plots for evaluating the fit of a linear
mixed-effects model represented by an lcc object. This function
provides six types of plots, including residual plots, fitted value
comparisons, and normal Q-Q plots. Users can select specific plots or display
all by default.
# 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 of class lcc, representing a
fitted longitudinal concordance correlation function.
A numeric vector specifying which plots to display. The valid range is c(1L:6L), corresponding to the plot types.
Captions for the plots, provided as a vector or list of valid graphics annotations. Default captions are provided for each plot.
A common sub-title for all plots; defaults to
NULL.
The main title for the plots, displayed above the captions.
Panel function to be used for adding points to the plots.
Defaults to panel.smooth if add.smooth is TRUE,
otherwise points.
Logical; indicates whether a smoother should be added
to most plots. Defaults to TRUE.
Logical; if TRUE, prompts the user before displaying
each plot in a multi-plot layout. Defaults to TRUE.
Number of extreme points to label in the first three plots.
Labels for the extreme points, defaulting to observation
numbers if NULL.
Positioning of labels in the left and right halves of the graph, applicable for plots 1-3.
Magnification factor for point labels.
Size of the plot captions.
Size of the overall margin annotation (applies only
if sub.caption is above the figures in multi-plot layouts).
Additional graphical parameters passed to par.
Thiago de Paula Oliveira, thiago.paula.oliveira@alumni.usp.br
The Q-Q plots use normalized residuals. Standardized residuals are pre-multiplied
by the inverse square-root factor of the estimated error correlation matrix,
while random effects are adjusted using the estimated variances from matrix G.
Simulation envelopes in Q-Q plots are generated using the hnp package.
The function is partly adapted from plot.lm.
lccPlot, lcc,
mtext, text, plotmath
if (FALSE) {
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 DataLab