Learn R Programming

nparLD (version 2.3.1)

plot.nparld_fit: Plot nparLD results

Description

Displays graphical summaries of estimated relative effects from an nparLD() fit. By default, the method plots the cell-level relative effects stored in x$effects. If term is supplied, it plots factor-specific relative effects and confidence intervals for selected main effects or interactions. Term-specific plots require that the model was fitted with Factor.Information = TRUE.

Usage

# S3 method for nparld_fit
plot(
  x,
  term = NULL,
  xlab = NULL,
  ylab = "Relative effect",
  main = NULL,
  legend.title = NULL,
  ref.line = 0.5,
  ref.lty = "dashed",
  ref.col = "grey40",
  ...
)

Arguments

x

An object of class "nparld_fit".

term

Optional character vector specifying one or more model terms for which factor-specific relative effects and confidence intervals should be plotted. The requested terms require Factor.Information = TRUE in the original call to nparLD(). If term = NULL, the cell-level relative effects in x$effects are plotted.

xlab

Optional x-axis label.

ylab

Optional y-axis label. The default is "Relative effect".

main

Optional plot title.

legend.title

Optional legend title.

ref.line

Optional horizontal reference line. The default is 0.5.

ref.lty

Line type for the reference line.

ref.col

Colour of the reference line.

...

Further arguments.

Details

The default plot displays the estimated cell-level relative effects. If term is supplied, the plot displays factor-specific relative effects and confidence intervals for the selected main effects or interactions. This requires that the model was fitted with Factor.Information = TRUE. The horizontal reference line at 0.5 indicates no tendency relative to the reference distribution. Values above 0.5 indicate a tendency toward larger responses, whereas values below 0.5 indicate a tendency toward smaller responses.

Examples

Run this code
# \donttest{
data(shoulder)

fit <- nparLD(
  resp ~ group1 * group2 * time,
  data = shoulder,
  subject = "subject",
  hypothesis = "H0p",
  Factor.Information = TRUE
)

## Cell-level relative effects
plot(fit)

## Factor-specific relative effects and confidence intervals
plot(fit, term = "time")
plot(fit, term = "group1:time")
# }

Run the code above in your browser using DataLab