Learn R Programming

spikeSlabGAM (version 1.1-7)

evalTerm: Get summaries of the posterior (predictive) distribution of the linear predictor of a model term

Description

Get summaries of the posterior (predictive) distribution of the linear predictor of a model term

Usage

evalTerm(label, model, newdata = NULL, aggregate = mean,
    quantiles = c(0.1, 0.9), returnData = TRUE)

Arguments

label
(character) the label of one of the terms in model.
model
a spikeSlabGAM object
newdata
data.frame on which to evaluate label. Defaults to NULL, in which case the term is evaluated on the original data.
aggregate
(function) a summary statistic that is applied over the mcmc-samples of the linear predictor. Defaults to mean.
quantiles
(numeric) a vector of quantiles for borders of credible regions of the linear predictor. Defaults to 10 and 90 percent quantiles, i.e. a (point-wise) 80 percent credible region.
returnData
should the relevant original variables be included in the returned data.frame? Defaults to TRUE.

Value

  • A data.frame that contains the relevant variables from newdata (if returnData is TRUE), the aggregate-summary and the requested quantiles.