Learn R Programming

BoomSpikeSlab (version 0.5.3)

model.matrix: GetPredictorMatrix

Description

Extract the matrix of predictors.

Usage

GetPredictorMatrix(object, newdata, na.action = na.omit, ...)

Arguments

object
An object of class glm.spike. The object must be a list with the following elements
  • beta: a matrix of MCMC draws, with rows representing draws, and columns representing coefficients.
  • xlevels: the levels of any contrasts pres
newdata
A data frame, matrix, or vector containing the predictors needed to make a prediction. If newdata is a matrix it must have the same number of columns as length(object$beta), unless it is off by one and the model contains an in
na.action
A function specifying what to do with NA's.
...
Extra arguments passed to model.matrix, in the event that newdata is a data frame.

Value

  • A matrix of predictor variables suitable for multiplication by object$beta.

See Also

lm.spike SpikeSlabPrior plot.lm.spike predict.lm.spike