FitGLMSubsets {DBModelSelect}R Documentation

Perform all subsets regression for generalized linear models

Description

Fit a specified generalized linear model on all subsets of covariates supplied. May be done in parallel if a cluster is supplied. Produces an output suitable for use with the StandICModelSelect function.

Usage

FitGLMSubsets(
  response,
  data,
  family,
  intercept = TRUE,
  force_intercept = TRUE,
  cluster = NULL,
  ...
)

Arguments

response

A character string specifying the name of the response variable.

data

A dataframe containing a column corresponding to the response variable in addition to columns for each covariate of interest.

family

A family suitable for supplying to the glm function specifying the error distribution and link function.

intercept

A logical indicating whether an intercept term should be considered in models. Defaults to TRUE.

force_intercept

A logical indicating whether to force an intercept term into all models if an intercept is desired. Defaults to TRUE.

cluster

A cluster created using parallel::makeCluster.

...

Additional arguments that may be supplied when calling glm to fit the models of interest.

Value

A list of fitted models suitable for use with the StandICModelSelect function.

Examples

# example code
# generate some data
data <- data.frame(s = rnorm(200), t = rnorm(200))
data$y <- data$s + rnorm(200)
# perform all subsets regression
model_list <- FitGLMSubsets(response = "y", data = data, family = gaussian(),
  intercept = TRUE, force_intercept = TRUE)
# perform model selection
model_select <- StandICModelSelect(model_list, IC = "AIC")

[Package DBModelSelect version 0.2.0 Index]