qhomtsub <-
function(isub,x,y,qval){
#
# Perform quantile regression using x[isub] to predict y[isub]
# isub is a vector of length n,
# a bootstrap sample from the sequence of integers
# 1, 2, 3, ..., n
#
# This function is used by other functions when computing
# bootstrap estimates.
#
# regfun is some regression method already stored in R
# It is assumed that regfun$coef contains the intercept and slope
# estimates produced by regfun. The regression methods written for
# this book, plus regression functions in R, have this property.
#
# x is assumed to be a matrix containing values of the predictors.
#
xmat<-matrix(x[isub,],nrow(x),ncol(x))
temp<-qplotreg(xmat,y[isub],qval=qval,plotit=FALSE)
regboot<-temp[1,2]-temp[2,2]
regboot
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.