I've generated the following data in R:
library(quantreg)
library(survival)
set.seed(789)
N <- 2000
u <- runif(N)
x1 <- rbinom(N,1,.5)
x2 <- rbinom(N,1,.5)
x1x2<-x1*x2
lambda <- 1 + 1.5*x1 + 1.5*x2 + .5*x1x2
k <- 2
y <- lambda*((-log(1-u))^(1/k));max(y)
c <- runif(N,max=15)
event = as.numeric(y<=c)
mean(event);table(event)
cens <- 1-event
table(cens)mean(cens)
time <-as.matrix(ifelse(event==1,y,c))
St<-Surv(time,event,type="right")
To which I've fit the following censored quantile regression model:
q2 <- crq(St~x1 + x2 + x1x2,tau=.9,method="Portnoy")
summary(q2)
As one can see, I'm interested in the 0.9th quantile. But summary(q2)
returns the 20th to 80th percentiles (by 20). How can I get only the 0.9th quantile (aka the 90th percentile)?? My problem is that, even though I request the 90th percentile in crq (i.e., "tau=0.9"), the summary function keeps returning the same set of (unwanted) percentiles (20th, 40th, 60th, 80th).