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

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/variable_selection.R

Description

BIC forward regression with generalised linear models.

Usage

1
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

1
2
3
4
5
6
7
8
## Not run: 
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

## End(Not run)

Rfast documentation built on May 18, 2021, 1:07 a.m.