Learn R Programming

FWDselect (version 1.1)

qselection: Selecting variables for several subset sizes

Description

Function that enables to obtain the best variables for more than one size of subset. Returns a table with the chosen covariates to be introduced into the models and their information criteria.

Usage

qselection(x, y, qvector, criterion = "deviance", method = "lm", 
family = "gaussian")

Arguments

x
A data frame containing all the covariates.
y
A vector with the response values.
qvector
A vector with more than one variable-subset size to be selected.
criterion
The cross-validation-based information criterion to be used. Default is the deviance. Other functions provided are the coefficient of determination ("R2") and residual variance ("variance").
method
A character string specifying which regression method is used, i.e., linear models ("lm"), generalized additive models ("glm") or generalized additive models ("gam").
family
This is a family object specifying the distribution and link to use in fitting: "gaussian", "binomial" or "poisson".

Value

  • qA vector of subset sizes.
  • criterionA vector of Information criterion values.
  • selectionSelected variables for each size.

See Also

selection

plot.qselection

Examples

Run this code
library(FWDselect)
data(pollution)
x=pollution[,-19]
y=pollution[,19]
obj2=qselection(x,y,qvector=c(1:4),method="lm",
criterion="R2")
obj2

Run the code above in your browser using DataLab