Plot difference surface based on model predictions.
plot_diff2(model, view, comp, cond = NULL, color = "topo", nCol = 100,
col = NULL, add.color.legend = TRUE, plotCI = FALSE, f = 1.96,
n.grid = 30, nlevels = 10, zlim = NULL, xlim = NULL, ylim = NULL,
main = NULL, xlab = NULL, ylab = NULL, rm.ranef = NULL,
transform.view = NULL, hide.label = FALSE, dec = NULL,
print.summary = getOption("itsadug_print"), ...)Name of continuous predictors that should be plotted on the x- and y-axes. Vector of two values.
Named list with the grouping predictor (categorical variable) and the 2 levels to calculate the difference for.
Named list of the values to use for the other predictor terms (not in view).
Colorpalette
Range of colors of background of contour plot.
Line color.
Logical: whether or not to add a color legend.
Default is TRUE. If FALSE (omitted), one could use the function
gradientLegend to add a legend manually at any position.
Logical: whether or not to plot confidence intervals.
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.
Resolution.
Levels of contour lines.
A two item array giving the lower and upper limits for the z- axis scale. NULL to choose automatically.
A two item array giving the lower and upper limits for the x- axis scale. NULL to choose automatically.
A two item array giving the lower and upper limits for the y- axis scale. NULL to choose automatically.
Title of plot.
Label x-axis.
Label y-axis.
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.
List with two functions for transforming
the values on the x- and y-axis respectively. If one of the axes
need to be transformed, set the other to NULL (no transformation).
(See fvisgam for more info.)
Logical: whether or not to hide the label (i.e., "difference"). Default is FALSE.
Numeric: number of decimals for rounding the color legend.
When NULL (default), no rounding. If -1 (default), automatically determined.
Note: if value = -1 (default), rounding will be applied also when
zlim is provided.
Logical: whether or not to print a summary.
Default set to the print info messages option
(see infoMessages).
Optional arguments for plotsurface.
If the result is not being plotted, a list is
returned with the estimated difference (est) and the standard error
over the estimate (se.est) and the x-values (x) is returned.
Other Testing for significance: compareML,
plot_diff, report_stats,
wald_gam
# NOT RUN {
data(simdat)
# }
# NOT RUN {
m1 <- bam(Y ~ Group + te(Time, Trial, by=Group),
data=simdat)
plot_diff2(m1, view=c('Time', 'Trial'),
comp=list(Group=c("Children", "Adults")))
# }
Run the code above in your browser using DataLab