qrlinear: Quantile regression using R.

Description Usage Arguments Value Examples

Description

Quantile regression by Linear Programming using R. Which means turning Quantile regression into a linear programming problem

Usage

1
qrlinear(x, y, tau, Intercept = T)

Arguments

x

the observed value of independent variables x should be a vector or matrix.(numeric)

y

the observed value of dependent variable and y should be a vector. (numeric)

tau

the quantile level and tau should be in (0,1). (numeric)

Intercept

if TRUE then the reslut including the intercept coefficient (logical)

Value

the regression coefficients

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
data(engel)
b1hat<-matrix(NA,ncol=2,nrow=6);b2hat<-matrix(NA,ncol=2,nrow=6)
taus <- c(.05,.1,.25,.75,.9,.95)
for(i in 1:length(taus)){
 b1hat[i,]=qrlinear(income,foodexp,taus[i],Intercept=T)
 b2hat[i,]=rq(foodexp~income,taus[i])$coef
 }
 print(b1hat);print(b2hat)

## End(Not run)

YulieKing/StatComp18026 documentation built on May 29, 2019, 8:34 a.m.