set.seed(1968)
n <- 200
x <- rnorm(n)
y <- 5 + x + rnorm(n)
c <- 4 + x + rnorm(n)
d <- (y > c)
dat <- data.frame(y = y,x = x,c = c,d = d)
rm(x,y,c,d)
f2 <- crq(dat,survival::Surv(pmax(y,c), d, type = "left") ~ x,method = "Portnoy")
# Help page for function being twiddled
?quantreg::crq
Run the code above in your browser using DataLab