RobinCar2: Reliable Covariate Adjustment Package

package
statistics
Author

Daniel

Published

January 14, 2026

A Hot Topic in Clinical Trial Statistics

Covariate adjustment has been a hot topic now for a while in clinical trial statistics. Personally I witnessed this first hand at the Regulatory Industry Statistics Workshop 2023 in Bethesda, MD where I enjoyed conference short courses by Mouna Akacha, Kelly Van Lancker et al as well as Ting Ye, Jun Shao, Yanyao Yi and Marlena Bannick; and many presentations on this topic. In the same year, the FDA also released their guideline “Adjusting for Covariates in Randomized Clinical Trials for Drugs and Biological Products” which further stimulated interest in this area.

Why is covariate adjustment so “hot”? In short, because it can lead to more powerful clinical trial analyses, i.e., shorter confidence intervals or smaller p-values, while maintaining type I error control. Incorporating prognostic baseline covariates can result in a more efficient use of data.

Important Considerations for Covariate Adjustment

However, the FDA guideline highlights important considerations, including:

  • The method should provide valid inference under approximately the same minimal statistical assumptions as unadjusted estimation.
  • A covariate adjustment model should generally include strata variables and can also include covariates not used for stratifying randomization.
  • Robust standard error methods should be used and account for stratified randomization.

Another important aspect is that covariate adjustment methods must not be confused with the choice of unconditional or conditional treatment effect estimands. Covariate adjustment is a technique that can be applied to estimate either type of estimand, i.e., it provides estimators, not estimands.

Estimand vs. Estimator Choice: Correctly understanding covariate adjustment

R Packages for Covariate Adjustment in Randomized Clinical Trials

I still remember that Ting Ye and Yanyao Yi presented the RobinCar R package at their RISW 2023 short course, and I was immediately intrigued and chatted with Ting about a potential collaboration with openstatsware. RobinCar is an acronym for “Robust Inference for Covariate Adjustment in Randomized Clinical Trials”. It implements several covariate adjustment methods that meet the FDA guideline criteria, in particular methods which are robust to covariate adaptive randomization and model misspecification.

Fortunately, the RobinCar package has been maintained by Marlena Bannick and further supported by the Software Subteam of the ASA BIOP Covariate Adjustment Scientific Working Group, co-led by Dong Xi, Yanyao Yi and Liming Li. It aims to be “one of the most comprehensive libraries of existing and future methods on covariate adjustment”.

Introducing RobinCar2

Since then the new package RobinCar2 has been developed out of the Software Subteam, maintained by Liming Li. The idea was to create a more user-friendly and properly validated version in the RobinCar package family, and focus on the statistical methods which are deemed most reliable and important for clinical trial applications in the pharmaceutical research context. It has just been released on CRAN in version 0.2.2 here.

Luckily from the RCONIS side I got involved with the RobinCar2 package development as well in 2025, and contributed the survival analysis methods based on the 2023 paper by Ting Ye, Jun Shao and Yanyao Yi, “Covariate-Adjusted Log-Rank Test: Guaranteed Efficiency Gain and Universal Applicability.”. The corresponding vignette is available here and gives an accessible introduction and overview of the implemented survival analysis methods.

Survival Analysis with RobinCar2

Just to give a little bit of a teaser, here is example code which demonstrates both the covariate-adjusted stratified hazard ratio estimation as well as log-rank test with RobinCar2:

library(RobinCar2)

robin_surv(
  Surv(time, status) ~ age + meal.cal + strata(strata, ecog),
  treatment = sex ~ sr(1),
  data = surv_data
)
Model        : Surv(time, status) ~ age + meal.cal + strata(strata, ecog)
Randomization: sex ~ sr(1) (Simple)
Stratification variables:  strata, ecog 
Covariates adjusted for: age, meal.cal (including interactions with sex)

Contrast     : Covariate-adjusted Stratified Log Hazard Ratio

                 Estimate Std.Err Z Value Pr(>|z|)   
Male v.s. Female  0.55219 0.19133  2.8861   0.0039 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Test         : Covariate-adjusted Stratified Log-Rank

                 Test Stat. Pr(>|z|)   
Male v.s. Female     2.9496 0.003181 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

That’s how simple it is to apply covariate adjustment in a robust and reliable way for survival analysis!

Give it a try and let us know how it goes. Any questions or issues please report in the GitHub repo here.

Happy covariate adjusting!