QREM_vs: Variable selection for quantile regression.

View source: R/QREM.R

QREM_vsR Documentation

Variable selection for quantile regression.

Description

Use the SEMMS package to perform variable selection. Iteratively alternate between QREM and fitSEMMS.

Usage

QREM_vs(
  inputData,
  ycol,
  Zcols,
  Xcols = c(),
  qn,
  nn = 5,
  nnset = NULL,
  maxRep = 40,
  initWithEdgeFinder = FALSE,
  mincor = 0.75
)

Arguments

inputData

A data frame or a file generated for a SEMMS analysis. See the SEMMS package for details. If a data frame, it will be saved in a tempfile.

ycol

The number of the column in the input file which should be used as the response.

Zcols

The columns in the input file which contain the putative variables.

Xcols

The columns in the input file which contain the fixed effects in the model (default is none, c()).

qn

The selected quantile. Must be in (0,1).

nn

The initial value for the number of non-null variables in SEMMS. Default is 5.

nnset

Optional: instead of an initial number of candidates, can specify the column numbers in the Z matrix for the first iteration. Default is null.

maxRep

The maximum number of iterations between QREM and fitSEMMS. Default=40.

initWithEdgeFinder

Determines whether to use the edgefinder package to find highly correlated pairs of predictors (default=FALSE).

mincor

To be passed to the fitSEMMS function (the minimum correlation coefficient between pairs of putative variable, over which they are considered highly correlated). Default is 0.75.

Examples


data(simLargeP)
qn <- 0.25
res <- QREM_vs(simLargeP, 1, 2:51, qn=qn)
dfsemms <- simLargeP[,c(1, 1+res$fittedSEMMS$gam.out$nn)]
qremFit <- QREM(lm, y~., dfsemms, qn=qn)
ests <- rbind(qremFit$coef$beta,
         sqrt(diag(bcov(qremFit,linmod=y~., df=dfsemms, qn=qn))))
rownames(ests) <- c("Estimate","s.d")


haimbar/QREM documentation built on Aug. 27, 2022, 7:10 p.m.