Build the prediction design matrix based on new data and model_matrices object created by modmat
pred_matrix.RdDeprecated. Use predict on the object returned by modmat instead, which does the same thing:
predict(modmat, newdata) in place of pred_matrix(modmat, newdata).
Arguments
- model_matrices
model_matrices object as returned from
modmat- newdata
data frame containing the variables in the formula and new data for which to evaluate the basis
- what
optional character string specifying which formula to use for prediction if
model_matricescontains multiple formulas.- exclude
optional vector of terms to set to zero in the predicted design matrix. Useful for predicting main effects only when e.g.
s(..., bs = "re")terms are present. Seemgcv::predict.gamfor more details.
See also
predict, which replaces this function
Examples
modmat = modmat(~ s(x), data.frame(x = 1:10))
# deprecated:
# Z_p = pred_matrix(modmat, data.frame(x = 1:10 - 0.5))
# use instead:
Z_p = predict(modmat, data.frame(x = 1:10 - 0.5))