boot.QREM: Bootstrap estimates for the standard errors of the...

View source: R/QREM.R

boot.QREMR Documentation

Bootstrap estimates for the standard errors of the coefficients in a quantile regression model.

Description

In the fixed effects case, the bcov function provides less variable, and faster estimates through the asymptotic covariance (Bahadur's representation). For mixed models bcov may also be used - it provides good coverage probability in simulations (using the BLUPs for the random effects)

Usage

boot.QREM(
  func,
  linmod,
  dframe0,
  qn,
  n,
  userwgts = NULL,
  ...,
  sampleFrom = NULL,
  B = 100,
  err = 10,
  maxit = 1000,
  tol = 0.001,
  maxInvLambda = 300,
  seedno = 71371,
  showEst = FALSE
)

Arguments

func

The fitting function (lm, lmer, gam).

linmod

A formula (the linear model for fitting in the M step).

dframe0

The design matrix. A data frame containing the columns in the formula specified in linmod.

qn

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

n

The number of samples to be used in the bootstrap.

userwgts

The user-provided sampling weights (optional. Default=NULL.)

...

Any arguments to be passed to func (except for the formula and weights)

sampleFrom

A subset of rows in dframe0 to sample from (for mixed models). Default=NULL.

B

The number of bootstrap iterations (default=100).

err

The initial value for the estimation error (default=10).

maxit

The maximum number of EM iterations (default=1000).

tol

The error tolerance level (default=0.001).

maxInvLambda

The maximum value of the weight for WLS fitting (default=300).

seedno

The seed for reproducibility (default=71371).

showEst

Boolean - whether to show an estimated completion time for the bootstrap. Default=FALSE.

Value

A matrix of the QR coefficients (B rows).

Examples


#data(simdf)
#qremFit <-  QREM(lm,linmod=y~x*x2 +x3, df=simdf, qn=0.2)
#estBS <- boot.QREM(lm, linmod=y~x*x2 +x3, df = simdf, qn=0.2,
#    n=nrow(simdf), B=50)
#apply(estBS,2,sd)


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