ELCICglm: Variable selection based on ELCIC under the syntax of GLM...

View source: R/main_function.R

ELCICglmR Documentation

Variable selection based on ELCIC under the syntax of GLM (Main function).

Description

The function ELCICglm provides the variable selection under the syntax of the GLM package.

Usage

ELCICglm(models, data, family)

Arguments

models

A list of formulas. See the corresponding documentation to glm.

data

A data frame containing the variables in the model.

family

A description of the error distribution and link function to be used in the model. The details are given under "Details".

Details

Three commonly used distributions are considered: "gaussian", "poisson", "binomial". For the current package, the identity link is considered for a "gaussian" distribution; the log link is considered for a "poisson" distribution; the logit link is considered for a "binomial" distribution;

Value

A list with two items: model selection results based on ELCIC, AIC, BIC, and GIC; An object of "glm" based on the selected model.

Examples

## tests
# load data
data(glmsimdata)
dat <- data.frame(y=glmsimdata$y, glmsimdata$x) ####x is a covariate matrix.
models <- list(y~x1, y~x1+x2, y~x1+x2+x3)
output<-ELCICglm(models, dat, poisson())
output$model.selection
output$glm.output


ELCIC documentation built on Feb. 16, 2023, 7:18 p.m.