predict.bma | R Documentation |
Expected value of prediction based on 'bma' object
## S3 method for class 'bma' predict(object, newdata = NULL, exact = FALSE, topmodels = NULL, ...)
object |
a bma object - see |
newdata |
An optional data.frame, matrix or vector containing variables with which to predict. If omitted, then (the expected values of) the fitted values are returned. |
exact |
If |
topmodels |
index of the models with whom to predict: for instance,
|
... |
further arguments passed to or from other methods. |
A vector with (expected values of) fitted values.
coef.bma
for obtaining coefficients,
bms
for creating bma objects, predict.lm
for a
comparable function
Check http://bms.zeugner.eu for additional help.
data(datafls) mm=bms(datafls,user.int=FALSE) predict(mm) #fitted values based on MCM frequencies predict(mm, exact=TRUE) #fitted values based on best models predict(mm, newdata=1:41) #prediction based on MCMC frequencies predict(mm, newdata=datafls[1,], exact=TRUE) #prediction based on a data.frame # the following two are equivalent: predict(mm, topmodels=1:10) predict(mm[1:10], exact=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.