View source: R/variable_selection.R
Backward selection regression | R Documentation |
Backward selection regression.
bs.reg(y, x, alpha = 0.05, type = "logistic")
y |
A numerical vector with the response variable values. It can either be of 0 and 1 values (Logistic regression) or of integer values 0, 1, 2,... (Poisson regression). |
x |
A numerical matrix with the candidate variables. |
alpha |
Threshold (suitable values are in [0,1]) for assessing the significance of p-values. The default value is at 0.05. |
type |
For the Logistic regression put "logistic" (default value) and for Poisson type "poisson". |
This function currently implements only the binary Logistic and Poisson regressions. If the sample size is less than the number of variables a notification message will appear and no backward regression will be performed.
The output of the algorithm is an S3 object including:
info |
A matrix with the non selected variables and their latest test statistics and p-values. |
Vars |
A vector with the selected variables. |
Marios Dimitriadis
R implementation and documentation: Marios Dimitriadis <mtsagris@csd.uoc.gr>
fs.reg, univglms, cor.fsreg
y <- rbinom(50, 1, 0.5)
x <- matrnorm(50, 10)
res<-bs.reg(y, x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.