plot.lcc | R Documentation |
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 class '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, ...)
x |
An object of class |
which |
A numeric vector specifying which plots to display. The valid range is c(1L:6L), corresponding to the plot types. |
caption |
Captions for the plots, provided as a vector or list of valid graphics annotations. Default captions are provided for each plot. |
sub.caption |
A common sub-title for all plots; defaults to
|
main |
The main title for the plots, displayed above the captions. |
panel |
Panel function to be used for adding points to the plots.
Defaults to |
add.smooth |
Logical; indicates whether a smoother should be added
to most plots. Defaults to |
ask |
Logical; if |
id.n |
Number of extreme points to label in the first three plots. |
labels.id |
Labels for the extreme points, defaulting to observation
numbers if |
label.pos |
Positioning of labels in the left and right halves of the graph, applicable for plots 1-3. |
cex.id |
Magnification factor for point labels. |
cex.caption |
Size of the plot captions. |
cex.oma.man |
Size of the overall margin annotation (applies only
if |
... |
Additional graphical parameters passed to |
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
.
Thiago de Paula Oliveira, thiago.paula.oliveira@alumni.usp.br
lccPlot
, lcc
,
mtext
, text
, plotmath
## Not run:
fm1 <- lcc(data = hue, subject = "Fruit", resp = "H_mean",
method = "Method", time = "Time", qf = 2, qr = 2)
plot(fm1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.