View source: R/model_selection.R
ELCIC.glm | R Documentation |
The function ELCIC.glm
provides the overall procedure for variable selection in GLM.
ELCIC.glm(x,y,candidate.sets,name.var.sets=NULL,dist)
x |
A matrix containing covariates. The first column should contain all ones corresponding to the intercept if the intercept is expected in the mean structure. |
y |
A vector containing outcomes. |
candidate.sets |
A list containing index corresponding to candidate covariates in each candidate model. See more in details section. |
name.var.sets |
A list containing names of candidate covariates corresponding to each candidate model. The names should be subset of column names of the x matrix. See more in details section. |
dist |
A specified distribution. It can be "gaussian", "poisson",and "binomial". |
"x" and "y" should be all observed. The corresponding individual data will be deleted if any missingness is detected.
Either arguments "candidate.sets" or "name.var.sets" is used to identify the set of candidate mean model. If both arguments are provided, only the argument "name.var.sets" will be used.
A matrix with each element containing ELCIC value for each candidate model (in columns) and (in rows)
## tests # load data data(glmsimdata) x<-glmsimdata$x y<-glmsimdata$y #candidate model index candidate.sets<-list(c(1,2),c(1,2,3),c(1,2,3,4)) criteria<-ELCIC.glm(x, y, candidate.sets, name.var.sets = NULL, dist="poisson") criteria
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.