Usage
plot_diff(model, view, comp, cond = NULL, plotCI = TRUE, f = 1.96,
eegAxis = FALSE, col = "black", shade = TRUE, n.grid = 100,
add = FALSE, print.summary = getOption("itsadug_print"), plot = TRUE,
rm.ranef = NULL, main = NULL, ylab = NULL, xlab = NULL, xlim = NULL,
ylim = NULL, transform.view = NULL, mark.diff = TRUE,
hide.label = FALSE, ...)
Arguments
model
A GAMM model, resulting from the functions
gam
or bam
. view
Name of continuous predictor that should be plotted on the x-
axis.
comp
Named list with the grouping predictor (categorical variable)
and the 2 levels to calculate the difference for.
cond
A named list of the values to use for the predictor terms.
Variables omitted from this list will have the closest observed value to
the median for continuous variables, or the reference level for factors.
plotCI
Logical: whether or not to plot confidence intervals.
Default is TRUE.
f
A number to scale the standard error. Defaults to 1.96, resulting
in 95% confidence intervals. For 99% confidence intervals use a value of
2.58.
eegAxis
Logical: whether or not to reverse the y-axis, plotting
negative values upwards. Default is FALSE.
col
Line color. Shading color is derived from line color.
shade
Logical: plot shaded confidence interval (TRUE)
or dashed lines that indicate confidence region (FALSE).
n.grid
Number of data points sampled as predictions. Defaults to 100.
add
Logical: whether or not to add the line to an existing plot.
Default is FALSE.
When no plot window is available and add=TRUE
,
the function will generate an error.
print.summary
Logical: whether or not to print the summary.
Default set to the print info messages option
(see infoMessages
). plot
Logical: whether or not to plot the difference. If FALSE, then
the output is returned as a list, with the estimated difference
(est
) and the standard error over the estimate (se.est
) and
the x-values (x
). Default
rm.ranef
Logical: whether or not to remove random effects.
Default is FALSE. Alternatively a string (or vector of strings) with the
name of the random effect(s) to remove.
main
Text string, alternative title for plot.
ylab
Text string, alternative label for y-axis.
xlab
Text string, alternative label for x-axis.
xlim
Range of x-axis. If not specified, the function automatically
generates an appropriate x-axis.
ylim
Range of y-axis. If not specified, the function automatically
generates an appropriate y-axis.
transform.view
Function for transforming
the values on the x-axis. Defaults to NULL (no transformation).
(See plot_smooth
for more info.) mark.diff
Logical: whether or not marking where the difference
is significantly different from 0.
hide.label
Logical: whether or not to hide the label
(i.e., "difference"). Default is FALSE.
...
Optional arguments for plot.