predict.BranchGLMVS {BranchGLM} | R Documentation |
Predict Method for BranchGLMVS or summary.BranchGLMVS Objects
Description
Obtains predictions from BranchGLMVS or summary.BranchGLMVS objects.
Usage
## S3 method for class 'BranchGLMVS'
predict(object, which = 1, ...)
## S3 method for class 'summary.BranchGLMVS'
predict(object, which = 1, ...)
Arguments
object |
a |
which |
a positive integer to indicate which model to get predictions from, the default is 1 which is used for the best model. For the branch and bound algorithms the number k is used for the kth best model and for the stepwise algorithms the number k is used for the model that is k - 1 steps away from the final model. |
... |
further arguments passed to predict.BranchGLM. |
Value
A numeric vector of predictions.
See Also
Examples
Data <- iris
Fit <- BranchGLM(Sepal.Length ~ ., data = Data,
family = "gamma", link = "log")
# Doing branch and bound selection
VS <- VariableSelection(Fit, type = "branch and bound", metric = "BIC",
bestmodels = 10, showprogress = FALSE)
## Getting predictions from best model
predict(VS, which = 1)
## Getting linear predictors from 5th best model
predict(VS, which = 5, type = "linpreds")
[Package BranchGLM version 2.1.6 Index]