[R] Quantile regression interval prediction

Angel Marley angel_nauti at yahoo.com
Fri Jul 10 03:08:43 CEST 2015


Hi all,I would like to know how to predict a new y value and its confidence interval for the prediction given a new observation x when using a linear(or non-linear) quantile regression model.How it is possible to transform the confidence prediction in to an interval prediction?
Is it correct to assume the same as in a lineal model prediction to transform the confidence prediction into an interval prediction?Is there any code or package to do this?

Here is a simple example.
require(quantreg)
x<-runif(10,0,5)
y<-0.3+ x*05 + rnorm(10, 0,3)

mod1<-lm(y~x)

# Values to get predictions
newval<-data.frame(x=c(3,7))
pred1<-predict(mod1, newval, interval = "prediction")# in lm is ok

mod2<- rq(y~x, tau=0.95)
pred2<-predict(mod2, newval, interval = "confidence")

Many Thanks in advanceAngel



 


	[[alternative HTML version deleted]]



More information about the R-help mailing list