plot.lcc: Diagnostic Plots for an 'lcc' Object

View source: R/methods.R

plot.lccR Documentation

Diagnostic Plots for an lcc Object

Description

Generates 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.

Usage

## 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, ...)

Arguments

x

An object of class lcc, representing a fitted longitudinal concordance correlation function.

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 NULL.

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 panel.smooth if add.smooth is TRUE, otherwise points.

add.smooth

Logical; indicates whether a smoother should be added to most plots. Defaults to TRUE.

ask

Logical; if TRUE, prompts the user before displaying each plot in a multi-plot layout. Defaults to TRUE.

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 NULL.

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 sub.caption is above the figures in multi-plot layouts).

...

Additional graphical parameters passed to par.

Details

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.

Author(s)

Thiago de Paula Oliveira, thiago.paula.oliveira@alumni.usp.br

See Also

lccPlot, lcc, mtext, text, plotmath

Examples

## Not run: 
fm1 <- lcc(data = hue, subject = "Fruit", resp = "H_mean",
           method = "Method", time = "Time", qf = 2, qr = 2)
plot(fm1)

## End(Not run)


Prof-ThiagoOliveira/lcc documentation built on Dec. 9, 2023, 12:10 a.m.