Plots the estimated linear predictor for a model term, i.e a main effect or a
(2- or 3-way) interaction. Plots for the joint effect of two numerical
covariates show an overlay if quantiles were specified: Regions where the
pointwise credible intervals do not contain zero are plotted in muted red
(\(>0\)) and blue (\(< 0\)), overlaid by coloured contour lines that show
the aggregate
values. Contour lines are shown only inside the convex
hull of the original observations. Plots for
srf
:lin
terms show the spatially varying
coefficient, i.e. the contour lines represent the change in the linear
predictor when the lin
-covariate increases by 1 standard deviation.
For this reason, a cumulative plot makes no sense and the routine will set
cumulative = FALSE
with a warning.
plotTerm(
label,
m,
cumulative = TRUE,
aggregate = mean,
quantiles = c(0.1, 0.9),
gridlength = 40,
contours = 30,
ggElems = list()
)
(character) the label of the effect to be plotted.
a fitted spikeSlabGAM
model
Defaults to TRUE, in which case the lower order terms that
are associated with the covariates involved in label
are cumulated
and then plotted. (e.g, if label
denotes a smoooth term, the sum of
the linear and smooth effect is displayed if TRUE, if label
is a
factor-factor interaction, the sum of both main effects and their
interaction is displayed etc.) If FALSE, only the marginal effect of
label
is displayed.
(function) which summary statistic to use for the posterior of the effect. Defaults to the mean.
which quantiles to use for the borders of credible regions. Defaults to 10 regions. Cannot deal with more than two quantiles.
length of the (univariate) grids on which to evaluate the posterior.
use how many contour lines for the joint effect of two numerical covariates. Defaults to 30.
a list of plot elements to give to
ggplot
. Use this to supply custom themes, colour
schemes etc. Defaults to an empty list, which yields the standard settings.
an object of class ggplot
. Use print
or wrap the call
to plotTerm
in parentheses to directly render on a graphic device.
Limitations: Plots for 4-way (or higher) interactions are not implemented.
Requesting such a plot will return the NULL object with a warning. Plots for
mrf
just treat the grouping variable as a conventional factor
i.e. will not incorporate any neighborhood or map information.
# NOT RUN {
#see help for spikeSlabGAM
# }
Run the code above in your browser using DataLab