Introduction
Many clinical regression analyses focus on the mean outcome. For example, an investigator may compare mean change from baseline between two treatment groups or fit a linear regression model for the average change in a biomarker.
The mean is often useful, but it does not tell the entire story.
Clinical outcomes can be strongly skewed, contain substantial heterogeneity, or respond differently among patients at different points of the outcome distribution.
For example, suppose a treatment changes a continuous clinical outcome by only a modest amount on average. It is possible that:
- patients with relatively favorable outcomes improve very little, while
- patients with severe outcomes experience a much larger improvement.
A mean regression model can obscure this pattern.
Quantile regression addresses this problem by modeling a specified conditional quantile of the outcome rather than only its conditional mean.
What Is a Quantile?
A quantile is a point that divides a distribution according to cumulative probability.
The most familiar quantiles are:
| Quantile | Common Name | Interpretation |
|---|---|---|
| 0.25 | 25th percentile | 25% of observations are at or below this value |
| 0.50 | Median | 50% of observations are at or below this value |
| 0.75 | 75th percentile | 75% of observations are at or below this value |
| 0.90 | 90th percentile | 90% of observations are at or below this value |
The median is therefore simply the 0.50 quantile.
Quantile regression generalizes regression from the mean to these other locations in the conditional outcome distribution.
Why the Median Can Be Clinically Useful
Consider a clinical outcome that is highly right-skewed.
Suppose most patients experience a modest change, but a small number experience very large changes.
Those extreme observations can substantially influence the mean.
The median is much less sensitive to extreme observations.
Quantile regression goes further by allowing investigators to examine several parts of the distribution rather than choosing between mean and median alone.
Ordinary Least-Squares Regression
In ordinary linear regression, the model is commonly written:
The model describes the conditional mean of the outcome.
For example, consider:
The coefficient \(\beta_1\) represents the adjusted difference in the conditional mean outcome between treatment groups.
That is a useful estimand, but it is only one feature of the conditional distribution.
Quantile Regression Changes the Target
Instead of modeling:
quantile regression models:
where \(\tau\) is the selected quantile.
For example:
is the conditional median, while:
is the conditional 75th percentile.
A basic linear quantile regression model is:
The coefficients are allowed to depend on \(\tau\).
Interpreting the Quantile Regression Coefficient
Suppose treatment is represented by a binary variable:
At quantile \(\tau\), the treatment coefficient is:
This represents the adjusted difference in the conditional \(\tau\)-th quantile of the outcome associated with treatment, under the fitted model.
For the median model, \(\beta_1(0.50)\) describes the treatment-associated difference in the conditional median outcome.
For the 75th percentile model, \(\beta_1(0.75)\) describes the corresponding difference at the conditional 75th percentile.
A Simple Example
Suppose a clinical trial evaluates change in a continuous symptom score at Week 12.
Assume that lower values indicate better symptoms.
A quantile regression analysis produces:
| Quantile | Treatment Coefficient | 95% CI | Interpretation |
|---|---|---|---|
| 0.25 | -1.2 | -2.3 to -0.1 | Small improvement in the lower portion of the outcome distribution |
| 0.50 | -3.5 | -4.8 to -2.2 | 3.5-point lower conditional median |
| 0.75 | -7.1 | -9.8 to -4.4 | Larger improvement in the upper portion |
The pattern suggests that the treatment effect is not constant across the distribution.
At the median, the adjusted treatment difference is 3.5 points.
At the 75th percentile, the difference is 7.1 points.
This may indicate that patients with relatively high symptom scores experience a larger treatment benefit.
Why Quantile Regression Is Attractive in Clinical Research
Clinical outcomes frequently violate the simple assumptions that make mean regression particularly convenient.
Examples include:
- Highly skewed laboratory measurements
- Healthcare utilization and cost outcomes
- Length of stay
- Time spent in a symptom state
- Change scores with substantial heterogeneity
- Patient-reported outcomes with ceiling or floor effects
- Functional scores with asymmetric distributions
- Biomarkers with extreme values
Quantile regression can provide a more complete description of treatment effects when the scientific question concerns different portions of the outcome distribution.
Mean Regression vs. Quantile Regression
| Feature | Mean Regression | Quantile Regression |
|---|---|---|
| Primary target | Conditional mean | Specified conditional quantile |
| Median effect directly estimated? | No | Yes, using \(\tau=0.50\) |
| Upper-tail effects | Not directly | Yes |
| Lower-tail effects | Not directly | Yes |
| Sensitivity to extreme outcomes | Often higher | Generally lower |
| Effect heterogeneity across distribution | May be obscured | Can be characterized |
| Normal outcome required? | No | No |
The Check Function and Quantile Loss
Quantile regression is not estimated by ordinary least squares.
Instead, the model minimizes an asymmetric loss function known as the check function, or pinball loss.
For quantile \(\tau\), define:
where \(u\) is the residual.
Equivalently:
The fitted coefficients minimize the sum of these asymmetric losses.
At the median, \(\tau=0.50\), the loss becomes symmetric and is closely related to minimizing absolute deviations.
The Quantile Regression Model
Suppose the outcome is a continuous clinical measure \(Y\), treatment is \(T\), and baseline disease severity is \(B\).
The quantile regression model at quantile \(\tau\) is:
The treatment coefficient is now explicitly indexed by \(\tau\).
At the 25th percentile:
At the median:
And at the 75th percentile:
A Worked Clinical Example
Consider a hypothetical randomized clinical trial comparing an active treatment with placebo.
The primary continuous outcome is change from baseline in a symptom severity score at Week 12.
Lower values represent better outcomes.
Suppose the analysis adjusts for baseline symptom severity.
| Variable | Description |
|---|---|
| \(Y\) | Week 12 symptom score |
| \(T\) | 1 = active treatment, 0 = placebo |
| \(B\) | Baseline symptom score |
| \(\tau\) | 0.25, 0.50, 0.75 |
The scientific question is not merely whether the treatment changes the average symptom score.
The investigators also want to know whether the treatment effect differs among patients with relatively low, typical, and high Week 12 symptom scores.
Fit Three Quantile Regression Models
Three models can be fit:
The resulting treatment estimates might look like:
| Quantile | Estimate | 95% CI | P-value |
|---|---|---|---|
| 25th | -1.4 | -2.7 to -0.1 | 0.036 |
| 50th | -3.2 | -4.5 to -1.9 | <0.001 |
| 75th | -6.0 | -8.1 to -3.9 | <0.001 |
The estimated treatment effect becomes progressively larger at higher quantiles.
This suggests that treatment benefit may be greater among patients toward the higher end of the Week 12 symptom-score distribution.
Step 1: Interpret the 25th Percentile
The estimated treatment coefficient is:
Holding baseline symptom severity constant, the model estimates a 1.4-point lower conditional 25th percentile for the active treatment compared with placebo.
Because lower scores represent better symptoms, this corresponds to a favorable treatment effect.
Step 2: Interpret the Median
The median treatment coefficient is:
After adjustment for baseline severity, the active treatment is associated with a 3.2-point lower conditional median symptom score compared with placebo.
This is the quantile-regression analogue of a median treatment effect in the specified conditional model.
Step 3: Interpret the 75th Percentile
The 75th-percentile treatment coefficient is:
Holding baseline severity constant, the estimated conditional 75th percentile is 6 points lower in the active-treatment group.
Because lower scores are clinically preferable, this represents a larger beneficial effect than the median estimate.
Why Baseline Adjustment Matters
Quantile regression can include the same types of covariates commonly used in other regression models.
For example:
- Treatment group
- Baseline outcome
- Age
- Sex
- Disease severity
- Study region
- Other prespecified prognostic variables
A baseline-adjusted model might be:
where \(A\) represents age.
The treatment coefficient is then interpreted conditional on the included covariates.
Quantile Regression Does Not Require Normally Distributed Outcomes
One attractive feature of quantile regression is that it does not require the outcome itself to follow a normal distribution.
This can be useful for clinical outcomes that are:
- Skewed
- Heavy-tailed
- Heteroscedastic
- Non-normal
However, this does not mean that quantile regression is assumption-free.
The validity of inference still depends on issues such as model specification, dependence, sample size, covariate structure, and the method used to estimate standard errors.
Heteroscedasticity and Quantile Regression
In ordinary least-squares regression, heteroscedasticity means that the variance of the residuals changes across the range of predicted values or covariates.
Quantile regression is particularly useful when the spread of the outcome distribution changes with predictors.
For example, suppose variability in a biomarker becomes much larger among patients with severe disease.
A mean model may estimate the average treatment effect but provide limited information about this changing spread.
Quantile regression can show whether treatment effects differ at lower and upper conditional quantiles.
Quantile Regression and Effect Heterogeneity
Suppose the estimated treatment effects are:
| Quantile | Treatment Effect |
|---|---|
| 0.10 | -0.5 |
| 0.25 | -1.4 |
| 0.50 | -3.2 |
| 0.75 | -6.0 |
| 0.90 | -8.1 |
The treatment effect clearly becomes larger at higher quantiles.
This is evidence of distributional heterogeneity in the conditional treatment effect.
The pattern could suggest that patients with worse outcomes benefit more from treatment.
However, the clinical interpretation must consider what the outcome scale means and whether the estimated differences are clinically meaningful.
Quantile Regression Is Not the Same as Subgroup Analysis
A common misconception is that a 75th-percentile treatment effect represents a treatment effect in a particular subgroup of patients.
It does not.
Quantile regression partitions the outcome distribution, not the patient population according to a baseline characteristic.
For example:
- Age > 65 years is a patient subgroup.
- Baseline disease severity > 8 is a patient subgroup.
- The 75th percentile of the outcome is a location in the outcome distribution.
These are fundamentally different concepts.
Quantile Regression vs. Median Regression
Median regression is simply quantile regression at:
Therefore:
Calling the method "median regression" is appropriate when only the median is being modeled.
The broader term "quantile regression" is preferable when multiple quantiles are analyzed.
Quantiles Commonly Used in Clinical Research
| Quantile | Potential Purpose |
|---|---|
| 0.10 | Examine lower-tail behavior |
| 0.25 | Lower portion of the outcome distribution |
| 0.50 | Median treatment effect |
| 0.75 | Upper portion of the distribution |
| 0.90 | Upper-tail behavior |
There is no universal requirement to use these particular quantiles.
The selected quantiles should be motivated by the clinical question and supported by adequate sample size.
Extreme Quantiles Require More Data
Estimating the median is generally easier than estimating a very extreme quantile.
For example, the 90th percentile is estimated using relatively little information from the upper tail.
In small clinical trials, estimates at \(\tau=0.90\) or \(\tau=0.10\) can therefore be unstable.
Confidence Intervals
Quantile regression coefficients should generally be reported with confidence intervals.
For a treatment coefficient at quantile \(\tau\):
This is the familiar large-sample form when an appropriate standard error is available.
In practice, quantile regression standard errors can be estimated using different approaches, including asymptotic methods and bootstrap methods.
Bootstrap Inference
Bootstrap methods are frequently useful for quantile regression inference, particularly when the sampling distribution is difficult to approximate reliably.
A basic bootstrap procedure is:
The bootstrap must respect the study design.
For example, in a randomized trial, the resampling strategy may need to preserve treatment structure or other relevant clustering depending on the analysis.
Independent Observations Are Important
The simplest quantile regression model assumes independent observations.
Clinical datasets often violate this assumption.
Examples include:
- Repeated measurements from the same patient
- Patients nested within clinical sites
- Matched observations
- Cluster-randomized trials
- Longitudinal assessments
Standard quantile regression should not simply be applied to repeated measurements while pretending that all observations are independent.
Quantile Regression With Categorical Covariates
Categorical predictors can be incorporated in the same general way as in ordinary regression.
For example, with treatment and sex:
The treatment coefficient continues to describe the adjusted difference in the specified conditional quantile.
Interaction Terms in Quantile Regression
Quantile regression can also investigate whether a treatment effect varies according to another covariate.
For treatment \(T\) and baseline severity \(B\):
The interaction coefficient is:
This coefficient can differ across quantiles.
Therefore, treatment-effect modification may itself be distribution-dependent.
Quantile Regression and Treatment Effect Heterogeneity
One of the most interesting applications in clinical research is exploring whether the treatment effect varies across the outcome distribution.
Suppose:
The treatment effect is much larger at the upper quantiles.
This can provide clinically important information that would not be apparent from a single mean difference.
But Different Coefficients Do Not Automatically Prove Heterogeneity
Suppose the estimates are:
| Quantile | Estimate | 95% CI |
|---|---|---|
| 25th | -1.0 | -3.0 to 1.0 |
| 50th | -3.0 | -5.0 to -1.0 |
| 75th | -6.0 | -10.0 to -2.0 |
The point estimates differ.
But that alone does not establish that the true treatment effects are statistically different from one another.
If the scientific question is whether:
then an appropriate formal comparison is needed.
Comparing Quantile-Specific Effects
A scientifically relevant contrast might be:
A large value of \(\Delta\), with an appropriate confidence interval or test, can provide evidence that the treatment effect differs across the distribution.
Such comparisons should account for the fact that multiple quantiles may be being evaluated.
Multiple Quantiles and Multiplicity
Suppose an investigator fits models at:
- 0.10
- 0.25
- 0.50
- 0.75
- 0.90
and reports a separate P-value for each treatment effect.
If all of these analyses are being used for confirmatory claims, multiplicity can become important.
The appropriate strategy depends on whether the quantiles are:
- Primary and secondary estimands
- Exploratory descriptive analyses
- Part of a prespecified hierarchical testing strategy
- Selected after examining the data
R Implementation
The most common R package for classical quantile regression is quantreg.
install.packages("quantreg")
library(quantreg)
Suppose the dataset is called trial and contains:
outcome— Week 12 clinical outcometreatment— treatment indicatorbaseline— baseline outcomeage— patient age
Fit a Median Regression Model
fit_median <- rq( outcome ~ treatment + baseline + age, tau = 0.50, data = trial ) summary(fit_median)
The argument:
tau = 0.50
specifies the conditional median.
Fit a 25th-Percentile Model
fit_q25 <- rq( outcome ~ treatment + baseline + age, tau = 0.25, data = trial ) summary(fit_q25)
This estimates the conditional 25th percentile.
Fit a 75th-Percentile Model
fit_q75 <- rq( outcome ~ treatment + baseline + age, tau = 0.75, data = trial ) summary(fit_q75)
This estimates the conditional 75th percentile.
Fit Several Quantiles at Once
The quantreg package can estimate several quantiles
in one model call.
fit_multi <- rq( outcome ~ treatment + baseline + age, tau = c(0.25, 0.50, 0.75), data = trial ) summary(fit_multi)
This is often convenient for examining how the treatment coefficient changes across the outcome distribution.
Bootstrap Standard Errors in R
A bootstrap-based summary can be requested using:
summary( fit_multi, se = "boot", R = 1000 )
where R = 1000 specifies the number of bootstrap
replicates.
For a production clinical analysis, the bootstrap approach and resampling scheme should be specified deliberately rather than chosen solely because it is convenient.
Extracting the Treatment Coefficients
Suppose treatment is represented by a variable called treatment.
coef(fit_multi)
The resulting matrix contains coefficient estimates for the modeled quantiles.
For example, conceptually the output may resemble:
tau= 0.25 tau= 0.50 tau= 0.75 (Intercept) 8.10 9.40 11.20 treatment -1.40 -3.20 -6.00 baseline 0.52 0.48 0.41 age 0.03 0.02 0.01
The treatment row is particularly important.
Here the estimated treatment effects are:
Visualizing Quantile Regression
A useful exploratory analysis is to estimate treatment effects over a grid of quantiles.
taus <- seq(0.10, 0.90, by = 0.05) fit_grid <- rq( outcome ~ treatment + baseline + age, tau = taus, data = trial ) coef_grid <- coef(fit_grid) coef_grid["treatment", ]
This allows the treatment coefficient to be examined as a function of the quantile.
A plot of:
can reveal whether the treatment effect is approximately constant or changes systematically across the outcome distribution.
Quantile Process Interpretation
Imagine the treatment coefficient follows this pattern:
| \(\tau\) | Treatment Effect |
|---|---|
| 0.10 | -0.3 |
| 0.20 | -0.8 |
| 0.30 | -1.5 |
| 0.40 | -2.4 |
| 0.50 | -3.2 |
| 0.60 | -4.0 |
| 0.70 | -5.1 |
| 0.80 | -6.4 |
| 0.90 | -7.3 |
This pattern suggests that the treatment effect becomes increasingly favorable at higher conditional quantiles.
A single mean regression coefficient would compress this entire pattern into one number.
Quantile Regression vs. Transforming the Outcome
Another common strategy for skewed outcomes is to transform the outcome.
For example:
and then fit ordinary linear regression to \(Y^*\).
Transformation can be useful, but it answers a different question.
Quantile regression directly models a specified quantile of the original outcome scale.
Quantile Regression vs. Robust Regression
Robust regression and quantile regression are related in that both can be useful when ordinary least squares is sensitive to unusual observations.
But they have different goals.
| Method | Primary Goal |
|---|---|
| OLS regression | Estimate conditional mean |
| Robust regression | Estimate a regression relationship with reduced sensitivity to influential observations |
| Median regression | Estimate conditional median |
| Quantile regression | Estimate conditional quantiles |
Quantile regression should therefore not be described simply as a "robust version of linear regression."
Clinical Outcomes That Can Benefit From Quantile Regression
Patient-Reported Outcomes
Patient-reported outcomes can exhibit skewness, ceiling effects, and substantial heterogeneity.
Quantile regression can help determine whether treatment effects are similar among patients with relatively low and high symptom burden.
Healthcare Costs
Cost outcomes are often strongly right-skewed.
A mean cost difference can be dominated by a relatively small number of patients with extremely high costs.
Quantile regression can characterize treatment differences at several points of the conditional cost distribution.
Length of Stay
Hospital length of stay can have a long upper tail.
Quantile regression can examine whether a treatment primarily affects typical patients or produces a particularly large effect among patients with long hospitalizations.
Biomarkers
Biomarker concentrations can be highly skewed.
Quantile regression can characterize treatment effects without requiring the outcome distribution to be approximately symmetric.
A More Detailed Clinical Example: Length of Stay
Suppose a clinical study evaluates an intervention intended to shorten hospitalization.
The outcome is length of stay in days.
The distribution is strongly right-skewed.
An ordinary regression model produces:
This suggests an average adjusted reduction of 0.8 days.
Now suppose quantile regression gives:
| Quantile | Treatment Effect |
|---|---|
| 25th | -0.2 days |
| 50th | -0.5 days |
| 75th | -1.4 days |
| 90th | -3.0 days |
This tells a much more detailed clinical story.
The intervention appears to have relatively little effect among patients with shorter hospital stays but a substantially larger effect among patients in the upper tail.
The intervention might therefore be particularly valuable for reducing prolonged hospitalization.
Conditional vs. Unconditional Quantiles
This distinction is extremely important.
An ordinary sample median is an unconditional quantile of the observed outcome distribution.
Quantile regression estimates a conditional quantile.
For example:
is the median of the outcome conditional on treatment and baseline severity.
It is not simply the median outcome among all patients in the treatment group.
Quantile Regression and Causal Interpretation
In a randomized clinical trial, treatment assignment can support causal interpretation under the usual assumptions of the randomized design.
However, the interpretation of a quantile treatment effect requires care.
A regression coefficient at a conditional quantile is not automatically identical to every possible definition of a causal quantile treatment effect.
In particular, conditional and marginal treatment effects can differ.
Investigators should therefore define the estimand clearly.
Missing Data
Quantile regression does not solve missing-data problems.
If Week 12 outcomes are missing, simply analyzing complete cases may introduce bias when missingness is informative.
Potential approaches include:
- Prespecified complete-case analysis
- Multiple imputation
- Inverse-probability weighting
- Sensitivity analyses
- Other model-based approaches
The appropriate method depends on the estimand, missingness mechanism, trial design, and regulatory context.
Ceiling and Floor Effects
Quantile regression can be informative for patient-reported or functional outcomes with ceiling or floor effects, but these features also create statistical challenges.
Suppose a large fraction of patients have the best possible score.
Several quantiles may then be concentrated at the boundary.
A simple continuous quantile regression model may not fully capture the data-generating process.
When Quantile Regression Is a Poor Choice
Quantile regression is powerful, but it is not universally appropriate.
Consider another modeling framework when:
- The outcome is binary.
- The outcome is a nominal categorical variable.
- The outcome is strongly ordinal and has few categories.
- The outcome contains extensive censoring.
- Repeated measurements require specialized dependence modeling.
- The scientific estimand is fundamentally a time-to-event quantity.
- The sample size is too small to estimate the desired quantiles reliably.
The method should follow the endpoint and estimand, not the other way around.
Sample Size Considerations
Sample-size planning for quantile regression can be more complicated than planning for ordinary mean regression.
The precision of a quantile estimate depends strongly on:
- The target quantile \(\tau\)
- The sample size
- The density of the outcome near that quantile
- The number and distribution of covariates
- The amount of residual variation
- The treatment allocation ratio
Extreme quantiles generally require substantially more information than central quantiles.
A study powered for a mean difference is not automatically powered for a clinically important 90th-percentile treatment effect.
Quantile Regression and Clinical Trial Reporting
A clear report should identify:
- The outcome definition
- The quantiles analyzed
- The regression covariates
- The treatment coding
- The estimation method
- The standard-error method
- The confidence-interval method
- The handling of missing data
- The primary quantile, if one was prespecified
- Any multiplicity strategy
- Any sensitivity analyses
Example Statistical Reporting
A concise report might state:
The wording makes clear that the estimates refer to conditional quantiles and not simply raw group medians.
Quantile Regression in a Randomized Trial
For a simple randomized trial, a model may contain only treatment:
This provides a direct quantile-specific treatment comparison.
A more efficient baseline-adjusted analysis may include the baseline outcome:
The exact covariate strategy should be prespecified and aligned with the primary estimand.
Checking the Model
Quantile regression does not have a single diagnostic plot analogous to the ordinary residual-vs-fitted plot that solves every model-checking problem.
Useful diagnostics include:
- Inspection of fitted conditional quantiles
- Assessment of influential observations
- Comparison of estimated quantiles across plausible model specifications
- Examination of coefficient stability across quantiles
- Assessment of nonlinear covariate relationships
- Evaluation of bootstrap stability
- Comparison with alternative reasonable models
Nonlinear Covariate Effects
A linear term for age assumes that its association with the specified conditional quantile is linear.
For example:
may be inadequate if the relationship is curved.
Quantile regression can incorporate:
- Polynomial terms
- Splines
- Restricted cubic splines
- Other flexible functions
For example:
library(splines) fit_spline <- rq( outcome ~ treatment + ns(age, df = 4) + baseline, tau = 0.50, data = trial )
The flexibility should be justified by the sample size and scientific model.
Quantile Crossing
When several quantile regression models are fitted separately, an undesirable phenomenon called quantile crossing can occur.
For example, the estimated 75th percentile should ordinarily not fall below the estimated 50th percentile at the same covariate values.
But separately estimated models can sometimes produce fitted curves that cross.
Possible approaches include constrained estimation or other methods designed to maintain quantile ordering.
Quantile Regression and the Outcome Distribution
It is useful to think of the conditional outcome distribution as a set of layers.
Common Mistakes
- Calling a quantile coefficient an individual treatment effect. A quantile coefficient describes a conditional distributional feature, not a guaranteed effect for an individual patient.
- Assuming quantile regression is completely assumption-free. The method has fewer distributional assumptions than ordinary least squares, but model specification and inference still matter.
- Confusing conditional and unconditional quantiles. A regression-adjusted conditional median is not necessarily the same as the raw observed group median.
- Using very extreme quantiles in a small trial. Tail quantiles can be unstable when sample size is limited.
- Claiming heterogeneity because one quantile is significant and another is not. The two coefficients must be compared directly.
- Ignoring repeated measurements. Standard quantile regression assumes an appropriate independence structure.
- Ignoring missing outcomes. Quantile regression does not automatically solve missing-data bias.
- Running dozens of quantiles without a prespecified analysis plan. Extensive quantile searching can create multiplicity and interpretation problems.
- Assuming quantile regression is always preferable to mean regression. The correct method depends on the scientific question and estimand.
- Ignoring the clinical scale. A statistically different quantile effect may not represent a clinically meaningful treatment benefit.
A Practical Quantile Regression Workflow
Example R Analysis From Start to Finish
The following example illustrates a basic analysis workflow.
library(quantreg) # Median model fit_q50 <- rq( outcome ~ treatment + baseline + age, tau = 0.50, data = trial ) # 25th percentile fit_q25 <- rq( outcome ~ treatment + baseline + age, tau = 0.25, data = trial ) # 75th percentile fit_q75 <- rq( outcome ~ treatment + baseline + age, tau = 0.75, data = trial ) # Model summaries summary(fit_q25) summary(fit_q50) summary(fit_q75)
The primary treatment coefficient can then be extracted from each model.
coef(fit_q25)["treatment"] coef(fit_q50)["treatment"] coef(fit_q75)["treatment"]
This produces the treatment effect at each target quantile.
Testing Whether Treatment Effects Vary Across Quantiles
Suppose the treatment coefficients are:
The difference is:
This means the estimated treatment effect at the 75th quantile is 4.6 points more favorable than the estimated treatment effect at the 25th quantile.
However, a formal inference procedure is needed before concluding that the difference is statistically significant.
Mean Effect and Quantile Effects Can Tell Different Stories
Consider the following hypothetical results:
| Estimand | Treatment Effect |
|---|---|
| Mean | -2.8 |
| 25th percentile | -0.5 |
| Median | -2.0 |
| 75th percentile | -5.5 |
The mean effect of -2.8 provides a useful summary.
But it does not reveal that the effect appears substantially larger in the upper part of the outcome distribution.
This may matter greatly clinically.
What Quantile Regression Adds to the Clinical Story
A mean analysis might conclude:
A quantile analysis can provide a richer conclusion:
The second statement describes information that the mean alone cannot provide.
Quantile Regression Does Not Replace Clinical Judgment
A statistically interesting pattern across quantiles does not automatically mean that treatment should be targeted to a particular group.
Investigators should consider:
- Clinical relevance of the effect size
- Precision of the estimates
- Prespecification
- Multiplicity
- Biological plausibility
- Consistency across analyses
- Missing-data assumptions
- Generalizability
Quantile regression is best viewed as a tool for describing and testing distributional treatment effects, not as a mechanism for automatically discovering clinically actionable subgroups.
How to Choose the Primary Quantile
The median is often a natural primary quantile because it is familiar, relatively stable, and less sensitive to extreme observations.
However, the median is not always the clinically most relevant estimand.
For example, if the primary clinical question concerns prolonged hospital stays, the 75th or 90th percentile might be scientifically meaningful.
The choice should therefore be based on:
- The clinical question
- The outcome distribution
- The expected treatment mechanism
- Sample size
- Precision
- Clinical interpretability
Quantile Regression and Protocol Design
If quantile regression is intended as a confirmatory analysis, the protocol and statistical analysis plan should identify:
- The primary outcome
- The primary quantile
- Secondary quantiles
- The treatment contrast
- Adjustment covariates
- Standard-error methodology
- Confidence-interval methodology
- Missing-data handling
- Multiplicity strategy
- Sensitivity analyses
This is particularly important when several quantiles will be tested.
Quantile Regression and Regulatory Interpretation
For regulatory-facing analyses, the estimand must be especially clear.
A statement such as:
"The median treatment effect was -3.2."
is less precise than:
"The baseline-adjusted treatment coefficient from the \(\tau=0.50\) conditional quantile regression model was -3.2 points."
The latter identifies exactly what was estimated.
Summary Table
| Concept | Key Point |
|---|---|
| Mean regression | Models the conditional mean |
| Quantile regression | Models a specified conditional quantile |
| Median regression | Quantile regression at \(\tau=0.50\) |
| 25th percentile | Describes the lower portion of the conditional outcome distribution |
| 75th percentile | Describes the upper portion of the conditional outcome distribution |
| Treatment coefficient | Quantile-specific adjusted treatment difference |
| Skewed outcomes | Quantile regression can be particularly informative |
| Extreme quantiles | Require sufficient information and can be unstable in small samples |
| Repeated measures | Require methods that account for within-patient dependence |
| Multiple quantiles | Multiplicity and interpretation should be considered |
The Most Important Concept
The most important idea in quantile regression is that a treatment effect does not have to be summarized by a single number.
A mean treatment effect answers:
Quantile regression allows a series of questions:
If those effects are similar, the treatment effect may be relatively uniform across the outcome distribution.
If they differ substantially, the treatment may have a distributionally heterogeneous effect.
References
Koenker, R. & Bassett, G. (1978). Regression quantiles. Econometrica, 46(1), 33–50.
Koenker, R. (2005). Quantile Regression.
Cambridge University Press.
Koenker, R. & Hallock, K.F. (2001). Quantile regression. Journal of Economic Perspectives, 15(4), 143–156.
Hao, L. & Naiman, D.Q. (2007). Quantile Regression.
SAGE Publications.
Davino, C., Furno, M. & Vistocco, D. (2014). Quantile Regression: Theory and Applications.
Wiley.
Koenker, R. (2024). quantreg: Quantile Regression.
R package documentation.