coef.BranchGLMVS {BranchGLM}R Documentation

Extract Coefficients from BranchGLMVS or summary.BranchGLMVS Objects

Description

Extracts beta coefficients from BranchGLMVS or summary.BranchGLMVS objects.

Usage

## S3 method for class 'BranchGLMVS'
coef(object, which = 1, ...)

## S3 method for class 'summary.BranchGLMVS'
coef(object, which = 1, ...)

Arguments

object

a BranchGLMVS or summary.BranchGLMVS object.

which

a numeric vector of indices or "all" to indicate which models to get coefficients 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.

...

ignored.

Value

A numeric matrix with the corresponding coefficient estimates.

Examples

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 coefficients from best model
coef(VS, which = 1)

## Getting coefficients from all best models
coef(VS, which = "all")


[Package BranchGLM version 2.1.6 Index]