bic.fs.reg: BIC forward regression with generalised linear models

View source: R/variable_selection.R

BIC forward regression with generalised linear modelsR Documentation

BIC forward regression with generalised linear models

Description

BIC forward regression with generalised linear models.

Usage

bic.fs.reg(y, x, tol = 2, type = "logistic") 

Arguments

y

A numerical vector.

x

A matrix with data, the predictor variables.

tol

If the BIC difference between two successive models is less than the tolerance value, the variable will not enter the model.

type

If you have a binary dependent variable, put "logistic". If you have count data, put "poisson".

Details

The forward regression tries one by one the variables using the BIC at each step for the latest variable. If the BIC of the regression model with that variable included, is less than "tol" from the previous model without this variable, the variable enters.

Value

A matrix with two columns, the index of the selected variable(s) and the BIC of each model.

Author(s)

Marios Dimitriadis

R implementation and documentation: Marios Dimitriadis <kmdimitriadis@gmail.com>.

References

Draper, N.R. and Smith H. (1988). Applied regression analysis. New York, Wiley, 3rd edition.

See Also

fs.reg, bic.corfsreg, cor.fsreg, score.glms, univglms, logistic_only, poisson_only, regression

Examples


x <- matrix(rnorm(200 * 50), ncol = 50)
## 200 variables, hence 200 univariate regressions are to be fitted
y <- rbinom(200, 1, 0.5)
a <- bic.fs.reg(y, x)
x <- NULL


Rfast documentation built on Nov. 9, 2023, 5:06 p.m.