ELCIC.glm.single: Variable selection in generalized linear models (GLM)

ELCIC.glm.singleR Documentation

Variable selection in generalized linear models (GLM)

Description

The function ELCIC.glm.single provides values of several model selection criteria including AIC, BIC, GIC, and ELCIC, given a candidate mean model.

Usage

ELCIC.glm.single(x, y, index.var=NULL, name.var = NULL, dist)

Arguments

x

A matrix containing covariates. The first column should contain all ones corresponding to the intercept if intercept is considered in your mean model.

y

A vector containing outcomes.

index.var

A vector containing index corresponding to candidate covariates (including the intercept). See more in details section.

name.var

A vector containing names of candidate covariates. The names should be subset of column names of x matrix. See more in details section.

dist

A specified distribution. It can be "gaussian", "poisson",and "binomial".

Details

"x" and "y" should be all observed. The corresponding individual data will be omitted in analysis if any missingness is detected.

Either arguments "index.var" or "name.var" is used to identify the candidate mean model. If both arguments are provided, only the argument "name.var" will be used.

Value

A vector containing information criteria including ELCIC, AIC, BIC, and GIC.

Examples

## tests
# load data
data(glmsimdata)
x<-glmsimdata$x
y<-glmsimdata$y
#candidate model index
name.var<-c("intercept","x1","x2")
index.var<-c(1,2,3)
criteria<-ELCIC.glm.single(x, y, index.var =index.var, name.var = NULL, dist="poisson")
criteria


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