fit.BranchGLMVS {BranchGLM} | R Documentation |
Fits GLMs for summary.BranchGLMVS and BranchGLMVS objects
## S3 method for class 'BranchGLMVS'
fit(object, which = 1, keepData = TRUE, keepY = TRUE, useNA = FALSE, ...)
fit(object, ...)
## S3 method for class 'summary.BranchGLMVS'
fit(object, which = 1, keepData = TRUE, keepY = TRUE, useNA = FALSE, ...)
object |
a |
which |
a positive integer indicating which model to fit, the default is to fit the first model . |
keepData |
Whether or not to store a copy of data and design matrix, the default
is TRUE. If this is FALSE, then the results from this cannot be used inside of |
keepY |
Whether or not to store a copy of y, the default is TRUE. If
this is FALSE, then the binomial GLM helper functions may not work and this
cannot be used inside of |
useNA |
Whether or not to use observations that had missing values in the full model, but not for this specific model. The default is FALSE. |
... |
further arguments passed to other methods. |
The information needed to fit the GLM is taken from the original information
supplied to the VariableSelection
function.
The fitted models do not have standard errors or p-values since these are biased due to the selection process.
An object of class BranchGLM.
Data <- iris
Fit <- BranchGLM(Sepal.Length ~ ., data = Data, family = "gaussian", link = "identity")
# Doing branch and bound selection
VS <- VariableSelection(Fit, type = "branch and bound", metric = "BIC",
bestmodels = 10, showprogress = FALSE)
## Getting summary of the process
Summ <- summary(VS)
## Getting the best model according to BIC
FinalModel <- fit(Summ, which = 1)
FinalModel
## Getting the 8th best model according to BIC
EighthModel <- fit(Summ, which = 8)
EighthModel