View source: R/main_function.R
ELCICglm | R Documentation |
The function ELCICglm
provides the variable selection under the syntax of the GLM package.
ELCICglm(models, data, family)
models |
A list of formulas. See the corresponding documentation to glm. |
data |
A data frame containing the variables in the model. |
family |
A description of the error distribution and link function to be used in the model. The details are given under "Details". |
Three commonly used distributions are considered: "gaussian", "poisson", "binomial". For the current package, the identity link is considered for a "gaussian" distribution; the log link is considered for a "poisson" distribution; the logit link is considered for a "binomial" distribution;
A list with two items: model selection results based on ELCIC, AIC, BIC, and GIC; An object of "glm" based on the selected model.
## tests # load data data(glmsimdata) dat <- data.frame(y=glmsimdata$y, glmsimdata$x) ####x is a covariate matrix. models <- list(y~x1, y~x1+x2, y~x1+x2+x3) output<-ELCICglm(models, dat, poisson()) output$model.selection output$glm.output
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.