Skip to main content

Censored Quantile Regression: How Long Do People Stay Off Drugs?

Censored quantile regression in R with quantreg::crq(), on a randomized trial of two drug treatment programs (575 patients, time to the return to drug use): quantiles of a time that is not fully observed, why ignoring or dropping the censored cases is wrong, Portnoy’s and Peng and Huang’s estimators, the link to Kaplan-Meier, inverse probability of censoring weights by hand, effects that change across the quantiles against one number from Weibull and Cox models, which quantiles can be estimated, and APA reporting.

The question: the typical time, when some times are unknown

Two residential programs treat people who are addicted to drugs. One is short, the other is longer. Patients were assigned to them at random. The outcome is the number of days until a patient returns to drugs. Does the longer program keep people off drugs for longer?

For about one patient in five the time is not known. They had not returned to drugs when the study lost sight of them, so we know only that their time is longer than some value. Such times are censored.

The usual answer is a survival model, such as the Cox model, which gives one number, a hazard ratio, for the whole time. But a program may do nothing for the patients who relapse in the first weeks, and a lot for those who hold out. One number hides that. And “the hazard is 22% lower” is hard to explain to a patient. Quantile regression answers in days: by how much does the longer program move the median time? The time by which a quarter of the patients have relapsed? Or three quarters?

Quantile regression needs complete data. Censored quantile regression is the version for times that are only partly known.

Code
library(quantreg)   # crq(): censored quantile regression; the data are also in this package
library(survival)   # Kaplan-Meier, Weibull and Cox models (comes with R)
library(ggplot2)

# number formats for the text
f0   <- function(x) formatC(x, format = "f", digits = 0, big.mark = ",")
f1   <- function(x) formatC(x, format = "f", digits = 1, big.mark = ",")
f2   <- function(x) formatC(x, format = "f", digits = 2, big.mark = ",")
f3   <- function(x) formatC(x, format = "f", digits = 3, big.mark = ",")
# no leading zero
nz <- function(x, d = 2) sub("^(-?)0", "\\1", formatC(x, format = "f", digits = d))
pval <- function(p) if (p < .001) "< .001" else paste("=", nz(p, 3))
pct  <- function(x, d = 0) paste0(formatC(100 * x, format = "f", digits = d), "%")

1. The data

The data are those of the UMARU IMPACT study, two randomized trials of residential treatment, which Hosmer and Lemeshow (1999) made well known in their textbook. They are in the package quantreg, and as a CSV file in the Rdatasets collection:

Code
uis <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/quantreg/uis.csv")
uis <- with(uis, data.frame(time = TIME, relapse = CENSOR, long = TREAT, age = (AGE - 32) / 10,
                            recent_iv = IV3, prior = NDT, site = SITE))
str(uis)
'data.frame':   575 obs. of  7 variables:
 $ time     : int  188 26 207 144 551 32 459 22 210 184 ...
 $ relapse  : int  1 1 1 1 0 1 1 1 1 1 ...
 $ long     : int  1 1 1 0 1 1 1 1 1 1 ...
 $ age      : num  0.7 0.1 0.1 0 -0.8 -0.2 0.7 -0.5 0.8 0.4 ...
 $ recent_iv: int  1 0 1 1 0 1 1 1 1 1 ...
 $ prior    : int  1 8 3 1 5 1 34 2 3 7 ...
 $ site     : int  0 0 0 0 0 0 0 0 0 0 ...
Code
c(patients = nrow(uis), relapsed = sum(uis$relapse), censored = sum(uis$relapse == 0))
patients relapsed censored 
     575      464      111 
Code
table(uis$long)

  0   1 
289 286 

time is the number of days from admission to the return to drugs, or to the end of observation. relapse is 1 if the return was observed and 0 if the time is censored (the file calls it CENSOR, with 1 for “not censored”, which is easy to misread). long is 1 for the longer programme, age is in decades from 32, recent_iv is 1 for recent use of injected drugs, prior is the number of earlier treatments and site distinguishes the two places. 19% of the times are censored.


2. Look at the data

Code
km <- survfit(Surv(time, relapse) ~ long, data = uis)
km_data <- data.frame(
  time = km$time,
  surv = km$surv,
  programme = rep(c("short", "long"), km$strata)
)
km_data <- rbind(data.frame(time = 0, surv = 1, programme = c("short", "long")), km_data)

ggplot(km_data, aes(time, surv, colour = programme)) +
  geom_step(linewidth = 0.9) +
  geom_hline(yintercept = c(0.25, 0.5, 0.75), linetype = "dotted", colour = "grey50") +
  scale_colour_manual(values = c(short = "#eb6834", long = "#2a78d6"), name = "programme") +
  scale_y_continuous(labels = function(v) paste0(100 * v, "%"), limits = c(0, 1)) +
  labs(
    title = "Share of patients who have not returned to drugs (Kaplan–Meier)",
    subtitle = "On a horizontal line, the gap between the curves is the difference of a quantile",
    x = "days since admission",
    y = NULL
  ) +
  theme_bw() +
  theme(legend.position = "bottom")

Plot: 2. Look at the data

Code
km_q <- quantile(km, c(0.1, 0.25, 0.5, 0.75))$quantile
rownames(km_q) <- c("short", "long")
km_q
      10 25    50  75
short 31 80 142.0 292
long  44 91 201.5 442

A quantile of the time is read horizontally off such a curve. The 25% quantile is the day by which a quarter of the patients have relapsed. Until then the two curves run together: 80 days in the short programme, 91 in the long one. At the median the gap is 60 days, and at the 75% quantile 150.

Why not just compute the quantiles?

Code
km_all <- quantile(survfit(Surv(time, relapse) ~ 1, data = uis), c(0.25, 0.5, 0.75, 0.82))$quantile
rbind(
  `Kaplan-Meier (right)` = km_all,
  `as if all were relapses` = quantile(uis$time, c(0.25, 0.5, 0.75, 0.82)),
  `without the censored cases` = quantile(uis$time[uis$relapse == 1], c(0.25, 0.5, 0.75, 0.82))
)
                             25  50     75     82
Kaplan-Meier (right)       84.0 170 377.00 659.00
as if all were relapses    84.5 170 375.50 537.68
without the censored cases 71.0 128 226.25 264.62

Dropping the censored cases is the worst: the patients who stayed off drugs longest are thrown away, and the median falls from 170 to 128 days. Taking the censored times as relapse times does little harm up to the 75% quantile here, because most of the censoring comes late in this study (half of the censored times are longer than 553 days). Above that it fails: 538 days for the 82% quantile instead of 659. In a study with earlier censoring the error would begin lower.


3. The model step by step, with formulas

Step 1: a line for each quantile

\[Q_{\log T}(\tau \mid x) = x^\top \beta(\tau)\]

\(Q(\tau \mid x)\) is the \(\tau\)-quantile of the log time of people with predictors \(x\). There is one vector \(\beta(\tau)\) for every \(\tau\) between 0 and 1. We use the logarithm because effects on times are naturally ratios. Quantiles allow that without any correction: the quantile of \(\log T\) is the log of the quantile of \(T\) (this does not hold for means). So \(e^{\beta(\tau)}\) says how many times longer the \(\tau\)-quantile is.

If all the \(\beta_j(\tau)\) are flat in \(\tau\), the predictor stretches the whole distribution by one factor, which is the accelerated failure time model. Censored quantile regression does not assume it.

Step 2: complete data, the check function

Without censoring, \(\hat\beta(\tau)\) minimizes \(\sum_i \rho_\tau(\log t_i - x_i^\top\beta)\), with the tilted absolute value \(\rho_\tau(u) = u\,(\tau - 1[u < 0])\) (see the page on quantile regression). All that matters for a case is whether it lies above or below the line.

Step 3: what a censored case tells

For a case censored at \(c\) we know that \(T > c\).

  • If the line for \(\tau\) passes below \(c\), the case is certainly above it. No problem.
  • If the line passes above \(c\), the case may be above or below. We do not know.

Step 4: Portnoy’s idea, split the case in two

Suppose that the case was crossed by the line at \(\tau_0\), that is, \(c\) is the \(\tau_0\)-quantile for such a person. Given that it is beyond \(c\), its probability of being below the \(\tau\)-quantile is

\[\frac{\tau - \tau_0}{1 - \tau_0}\]

So give the case two weights that add to 1. The weight \(\frac{\tau - \tau_0}{1 - \tau_0}\) stays at \(c\), and the rest goes to \(+\infty\), where it is certainly above the line. Work upwards, from small \(\tau\) to large, and update the weights as more censored cases are crossed (Portnoy, 2003). For one group without predictors this is the redistribution to the right, and the result is the Kaplan–Meier estimate. Peng and Huang (2008) use another route, through counting processes, which generalizes the Nelson–Aalen estimate. Both are in crq().

Step 5: how high can we go?

Beyond the last observed relapses there is no information. The Kaplan–Meier curve of these data stops at 17%, so quantiles above about 80% cannot be estimated.

Step 6: assumptions

The line must hold for all the quantiles up to \(\tau\), because the method works its way up from the bottom. And the censoring must be independent of the time, given the predictors. Patients who left the study because they had relapsed would break it.


4. Fitting the model and reading the output

The check: without predictors it is Kaplan–Meier

Code
only_programme <- crq(Surv(log(time), relapse) ~ long, data = uis, method = "Portnoy")
b0 <- coef(only_programme, taus = c(0.25, 0.5, 0.75))
rbind(crq_short = exp(b0[1, ]), km_short = km_q["short", c("25", "50", "75")],
      crq_long  = exp(b0[1, ] + b0[2, ]), km_long = km_q["long", c("25", "50", "75")])
          tau= 0.25 tau= 0.50 tau= 0.75
crq_short  79.47362  140.8350  298.2890
km_short   80.00000  142.0000  292.0000
crq_long   91.53645  202.1075  449.9034
km_long    91.00000  201.5000  442.0000

With the program as the only predictor, the fitted quantiles are the Kaplan–Meier quantiles of the two groups, up to the steps of the curves.

The full model

Code
model <- Surv(log(time), relapse) ~ long + age + recent_iv + prior + site
fit   <- crq(model, data = uis, method = "Portnoy")
taus  <- c(0.1, 0.25, 0.5, 0.75)
set.seed(61)
s <- summary(fit, taus = taus, R = 500)                    # bootstrap standard errors
s[[3]]$coefficients                                        # the median
                  Value    Lower Bd     Upper Bd   Std Error   T Value     Pr(>|t|)
(Intercept)  5.03477126  4.80522264  5.307066803 0.128023821 39.326832 0.0000000000
long         0.42396525  0.21386408  0.701771629 0.124468499  3.406205 0.0006587265
age          0.24009580  0.06767410  0.440167711 0.095025625  2.526643 0.0115158601
recent_iv   -0.16912208 -0.37920400  0.109294417 0.124619233 -1.357111 0.1747460684
prior       -0.01849863 -0.03149261 -0.002025701 0.007517206 -2.460839 0.0138612737
site         0.20843357 -0.02437885  0.450181841 0.121063626  1.721686 0.0851263900
Code
row_of <- function(term, col) sapply(s, function(q) q$coefficients[term, col])
eff <- data.frame(
  tau = taus,
  b = row_of("long", 1),
  SE = row_of("long", 4),
  low = row_of("long", 2),
  high = row_of("long", 3)
)
eff$ratio <- exp(eff$b)
round(eff, 3)
   tau     b    SE    low  high ratio
1 0.10 0.116 0.191 -0.314 0.434 1.123
2 0.25 0.355 0.156 -0.018 0.595 1.426
3 0.50 0.424 0.124  0.214 0.702 1.528
4 0.75 0.289 0.191 -0.064 0.685 1.335

The output for one quantile looks like that of an ordinary regression. The standard errors and the limits come from a bootstrap of the patients. Read the row of long:

  • At the median, b = 0.42: the median time of the long program is \(e^{0.42}\) = 1.53 times that of the short one, 95% CI [1.24, 2.02].
  • At the 10% quantile, 1.12 times, [0.73, 1.54]. The patients who relapse first do so at about the same time in both programs.
  • At the 75% quantile, 1.33 times, [0.94, 1.98]. The estimate is uncertain, because much of the information there is censored.

All the quantiles

Code
grid <- seq(0.05, 0.80, by = 0.025)
set.seed(62)
sg <- summary(fit, taus = grid, R = 300)
path <- do.call(
  rbind,
  lapply(c("long", "age", "recent_iv", "prior"), function(v) {
    data.frame(
      term = v,
      tau = grid,
      b = sapply(sg, function(q) q$coefficients[v, 1]),
      low = sapply(sg, function(q) q$coefficients[v, 2]),
      high = sapply(sg, function(q) q$coefficients[v, 3])
    )
  })
)
labels <- c(
  long = "longer programme",
  age = "ten years older",
  recent_iv = "recent injected drugs",
  prior = "one more prior treatment"
)
path$label <- factor(labels[path$term], levels = labels)

weibull <- survreg(
  Surv(time, relapse) ~ long + age + recent_iv + prior + site,
  data = uis,
  dist = "weibull"
)
lognorm <- survreg(
  Surv(time, relapse) ~ long + age + recent_iv + prior + site,
  data = uis,
  dist = "lognormal"
)
flat <- data.frame(label = factor(labels, levels = labels), b = coef(lognorm)[names(labels)])

ggplot(path, aes(tau, b)) +
  geom_hline(yintercept = 0, colour = "grey60") +
  geom_ribbon(aes(ymin = low, ymax = high), fill = "#2a78d6", alpha = 0.2) +
  geom_line(colour = "#2a78d6", linewidth = 0.9) +
  geom_hline(
    data = flat,
    aes(yintercept = b),
    colour = "#eb6834",
    linetype = "dashed",
    linewidth = 0.8
  ) +
  facet_wrap(~label, scales = "free_y") +
  labs(
    title = "Effects on the log time, across the quantiles",
    subtitle = "Blue: censored quantile regression, 95% bootstrap band.\nOrange: log-normal model, one number",
    x = "quantile τ (left: the patients who relapse early)",
    y = "coefficient"
  ) +
  theme_bw()

Path – All the quantiles

The effect of the longer program starts near zero, rises to about the middle and stays near that height. The effect of recent injected drugs is negative and has a hump: it is most harmful at both ends, and weak around the middle. The dashed lines are what a parametric model with one number per predictor says about the same data.


5. One number or many? Other models for the same data

Code
cox <- coxph(Surv(time, relapse) ~ long + age + recent_iv + prior + site, data = uis)
hr  <- exp(coef(cox)[["long"]]); hr_ci <- exp(confint(cox)["long", ])
zph <- cox.zph(cox)
wb  <- exp(coef(weibull)[["long"]]); ln <- exp(coef(lognorm)[["long"]])
ln_ci <- exp(confint(lognorm)["long", ])
cbind(
  value = c(
    hazard_ratio = hr,
    low = hr_ci[[1]],
    high = hr_ci[[2]],
    test_of_proportional_hazards = zph$table["long", "p"]
  )
)
                                  value
hazard_ratio                 0.78465836
low                          0.65309442
high                         0.94272547
test_of_proportional_hazards 0.05703045
Code
c(weibull_time_ratio = wb, lognormal_time_ratio = ln)
  weibull_time_ratio lognormal_time_ratio 
            1.278840             1.309739 
Code
AIC(weibull, lognorm)
        df      AIC
weibull  7 6186.212
lognorm  7 6148.340
Model What it says about the longer program
Cox hazard ratio 0.78, 95% CI [0.65, 0.94]: at any time, the rate of relapse is 22% lower
Weibull, log-normal the whole distribution is stretched by 1.28 or 1.31 times
Censored quantile regression 1.12 times at the 10% quantile, 1.53 times at the median, 1.33 times at the 75% quantile

The Cox model assumes that the ratio of the hazards is the same all the time. The test of this assumption has p = .057 for the program: a hint that it does not hold, in the same direction as the quantile picture (no difference at first, a difference later).

Is the change across quantiles real?

The bands are wide. A direct test: bootstrap the difference between the coefficients at the median and at the 10% quantile.

Code
set.seed(63)
boot_diff <- replicate(400, {
  m <- try(
    crq(model, data = uis[sample(nrow(uis), replace = TRUE), ], method = "Portnoy"),
    silent = TRUE
  )
  if (inherits(m, "try-error")) {
    return(c(NA, NA))
  }
  b <- coef(m, taus = c(0.1, 0.5))
  c(b["long", 2] - b["long", 1], b["long", 2])
})
d_est <- eff$b[3] - eff$b[1]
d_ci  <- quantile(boot_diff[1, ], c(0.025, 0.975), na.rm = TRUE)
c(difference = d_est, d_ci)
difference       2.5%      97.5% 
 0.3082665 -0.1164567  0.6999008 

The effect at the median is larger than at the 10% quantile by 0.31, 95% CI [-0.12, 0.70]. The interval includes zero: with 575 patients we cannot prove that the effect changes, although the estimates say so. It is good practice to say so, and not to tell a story about every bend of the curve.


6. The same by hand: inverse probability of censoring weights

There is another approach that needs only rq(). Use the observed relapses only, but give each of them a weight that makes up for the cases like it that were censored: one over the probability of not being censored before that time,

\[w_i = \frac{\text{relapse}_i}{\hat G(t_i)}\]

where \(\hat G\) is the Kaplan–Meier estimate of the censoring time (swap the roles of 0 and 1).

Code
G <- survfit(Surv(time, 1 - relapse) ~ 1, data = uis) # censoring is now the "event"
g_i <- stepfun(G$time, c(1, G$surv))(uis$time - 1e-6) # probability of still being observed
w   <- uis$relapse / g_i
range(w[w > 0])
[1]  1.00000 13.54863
Code
ipcw <- sapply(c(0.1, 0.25, 0.5, 0.75), function(t) {
  coef(rq(log(time) ~ long + age + recent_iv + prior + site, tau = t, data = uis, weights = w))
})
peng <- coef(crq(model, data = uis, method = "PengHuang"), taus = taus)
cbind(Portnoy = eff$b, PengHuang = peng["long", ], weights = ipcw["long", ])
            Portnoy  PengHuang   weights
tau= 0.10 0.1156987 0.08785313 0.0742559
tau= 0.25 0.3547384 0.34376313 0.1840154
tau= 0.50 0.4239652 0.41273339 0.4246990
tau= 0.75 0.2888036 0.30215990 0.3692874

Portnoy’s and Peng and Huang’s estimates of the effect of the program are close. The simple weights agree with them at the median and less at the other quantiles. The weights go up to 13.5: late relapses stand for many censored cases, and the upper quantiles are unstable for this reason. The simple weights also assume that the censoring does not depend on the predictors, which the other two do not need.


7. Predictions in days

The model gives whole distributions of times. Two patients of 32 with one prior treatment, at the first site, who had not injected recently, one in each program:

Code
newdata <- data.frame(long = c(0, 1), age = 0, recent_iv = 0, prior = 1, site = 0)
q_grid  <- seq(0.05, 0.80, by = 0.025)
B       <- coef(fit, taus = q_grid)
X_new   <- cbind(1, as.matrix(newdata))
days    <- exp(X_new %*% B)
pred <- data.frame(
  tau = rep(q_grid, each = 2),
  days = as.vector(days),
  programme = c("short", "long")
)
crossing <- apply(days, 1, function(v) sum(diff(v) < 0))
crossing
[1] 1 0
Code
pick <- function(p, t) pred$days[pred$programme == p & abs(pred$tau - t) < 1e-9]
Code
ggplot(pred, aes(days, 1 - tau, colour = programme)) +
  geom_line(linewidth = 1, orientation = "y") +
  scale_colour_manual(values = c(short = "#eb6834", long = "#2a78d6")) +
  scale_y_continuous(labels = function(v) paste0(100 * v, "%"), limits = c(0, 1)) +
  labs(
    title = "Predicted share of such patients who are still off drugs",
    x = "days since admission",
    y = NULL
  ) +
  theme_bw() +
  theme(legend.position = "bottom")

7. Predictions in days

For such a patient the model predicts a median of 151 days in the short program and 230 in the long one; for the 25% quantile 92 and 131 days. The lines for different quantiles are fitted separately and could cross, which would mean that a later quantile comes earlier. For these two patients, on the grid of 31 quantiles, the number of crossings was 1.


8. Things to keep in mind

  • Only quantiles that the data reach. With a third of the times censored, do not ask for the 90% quantile. crq() stops by itself; look at how far it went.
  • Randomized and not randomized predictors. The program was assigned at random, so its coefficients are effects. The others are differences between patients. Do not add variables that were measured after the assignment, such as how much of the program a patient completed: the program itself changes them.
  • What is “time to relapse” here? It includes the days in the program, and the long program lasts longer. Part of its advantage may simply be the days of treatment. A comparison from the end of the treatment is another question, and not a randomized one.
  • Portnoy or Peng–Huang? Both are good, and similar. Peng–Huang has simpler theory; Portnoy’s uses the data slightly more efficiently in some situations.
  • Fixed censoring at the same known point for everybody (a detection limit, a top-coded income) is another problem, with the estimator of Powell (1986; crq(..., method = "Powell")).
  • Bootstrap standard errors need many replications; 500 is a minimum for a paper. Set the seed.
  • Global linearity. The line must hold at all lower quantiles too. A bend at \(\tau\) = 0.1 spoils the estimates at 0.5. Look at the whole path.
  • Cox, parametric or quantile? If one number is true, the Cox or a parametric model is more precise. Quantiles need more data, and tell more.

9. Reporting the results in APA style

A report (APA 7th edition) needs the number of cases and events, the estimator, the scale of the outcome, the quantiles and why these, the bootstrap, and the estimates in time ratios or days. The numbers come from the R objects:

Code
terms <- c("long", "age", "recent_iv", "prior", "site")
cell <- function(q, t) {
  z <- s[[q]]$coefficients[t, ]
  paste0(f2(exp(z[1])), " [", f2(exp(z[2])), ", ", f2(exp(z[3])), "]")
}
apa_table <- data.frame(
  Predictor = c(
    "Longer programme", "Age (10 years)", "Recent injected drugs", "Prior treatments (each)", "Site"
  ),
  sapply(1:4, function(q) sapply(terms, cell, q = q)),
  row.names = NULL
)

Method (data analysis):

The time from admission to the return to drug use was analysed in 575 patients who had been randomly assigned to a shorter or a longer residential programme; 464 returned to drug use, and 111 times (19%) were censored. We estimated the 10%, 25%, 50% and 75% quantiles of the log time with censored quantile regression (Portnoy, 2003), adjusting for age, recent use of injected drugs, number of prior treatments and site. Exponentiated coefficients are ratios of quantiles of the time. Confidence intervals are based on 500 bootstrap samples. For comparison we fitted a Cox proportional hazards model and a log-normal accelerated failure time model. Analyses were conducted in R (Version 4.6.2; R Core Team, 2026) with the package quantreg (Koenker, 2008).

Results:

The median time to the return to drug use was 142 days in the short and 202 days in the long program (Kaplan–Meier). In the adjusted model the long program multiplied the median time by 1.53, 95% CI [1.24, 2.02]. At the other quantiles the intervals included 1: ratio = 1.12, 95% CI [0.73, 1.54], at the 10% quantile, 1.43, 95% CI [0.98, 1.81], at the 25% quantile and 1.33, 95% CI [0.94, 1.98], at the 75% quantile (Table 1). The difference between the effects at the 10% quantile and at the median was 0.31 on the log scale, 95% CI [-0.12, 0.70]. In the Cox model, the hazard ratio was 0.78, 95% CI [0.65, 0.94].

Table 1

Ratios of Quantiles of the Time to the Return to Drug Use

Predictor 10% 25% Median 75%
Longer programme 1.12 [0.73, 1.54] 1.43 [0.98, 1.81] 1.53 [1.24, 2.02] 1.33 [0.94, 1.98]
Age (10 years) 1.24 [0.94, 2.24] 1.37 [0.95, 1.88] 1.27 [1.07, 1.55] 1.63 [1.06, 2.59]
Recent injected drugs 0.54 [0.33, 0.97] 0.71 [0.51, 1.11] 0.84 [0.68, 1.12] 0.59 [0.35, 0.90]
Prior treatments (each) 0.98 [0.96, 1.01] 0.98 [0.94, 0.99] 0.98 [0.97, 1.00] 0.96 [0.93, 0.97]
Site 0.77 [0.43, 1.72] 0.92 [0.60, 1.49] 1.23 [0.98, 1.57] 0.99 [0.71, 1.65]

Note. N = 575, 464 relapses. Exponentiated coefficients of censored quantile regressions of the log time (Portnoy’s estimator), with 95% bootstrap intervals. Values above 1: a longer time to relapse.

Points to remember:

  • Give the number of events, not only of patients.
  • Say which quantiles can be estimated with this much censoring.
  • Report ratios (or days) with bootstrap intervals, and how many replications.
  • If you claim that an effect differs between quantiles, test the difference.

10. Summary

When A time (or another outcome) is censored, and you want effects on its median and other quantiles
The model \(Q_{\log T}(\tau \mid x) = x^\top\beta(\tau)\), one line per quantile
Censored cases Portnoy: split into a part that stays and a part that goes to infinity; without predictors this is Kaplan–Meier
How (R) quantreg::crq(Surv(log(time), event) ~ x, method = "Portnoy"), then summary(fit, taus, R)
Reading it \(e^{\beta(\tau)}\): how many times longer the \(\tau\)-quantile of the time is
Limits Quantiles beyond the last events; linearity at all lower quantiles; independent censoring
By hand rq() on the events with weights \(1/\hat G(t)\)
Related pages Quantile regression, Tobit

References

Hosmer, D. W., & Lemeshow, S. (1999). Applied survival analysis: Regression modeling of time to event data. Wiley.

Koenker, R. (2008). Censored quantile regression redux. Journal of Statistical Software, 27(6), 1–25. https://doi.org/10.18637/jss.v027.i06

Peng, L., & Huang, Y. (2008). Survival analysis with quantile regression models. Journal of the American Statistical Association, 103(482), 637–649. https://doi.org/10.1198/016214508000000355

Portnoy, S. (2003). Censored regression quantiles. Journal of the American Statistical Association, 98(464), 1001–1012. https://doi.org/10.1198/016214503000000954

Powell, J. L. (1986). Censored regression quantiles. Journal of Econometrics, 32(1), 143–155. https://doi.org/10.1016/0304-4076(86)90016-3