knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

R/drord

Travis-CI Build Status AppVeyor Build  Status Coverage Status CRAN CRAN downloads Project Status: Active - The project has reached a stable, usable state and is being actively developed. MIT license

Doubly robust estimators of treatment effects for ordinal outcomes

Author: David Benkeser


Description

drord is an R package that computes estimates of effect parameters that are useful for evaluating efficacy of treatments on ordinal outcomes. The effect estimates are covariate-adjusted, which means they can be used in observational settings or to gain efficiency in randomized trials.

The estimators implemented in the package are doubly robust, in that they are based on working models for the probability of treatment as a function of covariates (i.e., the propensity score) and for the CDF of the outcome as a function of covariates in each treatment arm. The latter working model is implemented via proportional odds models that are fit in each treatment arm separately. Estimates based on these two working models are combined to quantify the effects of the treatment on the ordinal outcome in three different ways:


Installation

A developmental release may be installed from GitHub via devtools with:

devtools::install_github("benkeser/drord")

Usage

Here we demonstrate calls to drord to compute treatment effects using a simulated data set of COVID-19 outcomes in hospitalized patients.

library(drord)

# load data
data(covid19)

# estimate treatment effects
fit <- drord(out = covid19$out, 
             covar = covid19[ , "age_grp", drop = FALSE],
             treat = covid19$treat)
# look at estimates
fit

There is a plot method included to visualize either the cumulative distribution or probability mass function of outcomes.

# plot of CDF
cdf_plot <- plot(fit, dist = "cdf", 
                 treat_labels = c("Treatment", "Control"),
                 out_labels = c("Death", "Death or intubation"))
cdf_plot$plot + ggsci::scale_fill_nejm()

The black bars are pointwise 95\% confidence intervals; the gray bars are simultaneous 95\% confidence intervals.

A similar plot can be made for the PMF.

# plot of PMF
pmf_plot <- plot(fit, dist = "pmf",
                 treat_labels = c("Treatment", "Control"),
                 out_labels = c("Death", "Intubation", "None"))
pmf_plot$plot + ggsci::scale_fill_nejm()                 

Issues

If you encounter any bugs or have any specific feature requests, please file an issue.


Citation

After using the drord R package, please cite both of the following:

@Manual{drordpackage,
  title = {drord: Doubly-Robust Estimators for Ordinal Outcomes},
  author = {David Benkeser},
  note = {R package version 1.0.1}
}

@article{benkeserdiazluedtke2020,
  title = {Improving Precision and Power in Randomized Trials for COVID-19 Treatments Using Covariate Adjustment, for Ordinal or Time to Event Outcomes},
  journal = {Biometrics},
  doi = {https://doi.org/10.1111/biom.13377}
}

License

© 2020- David Benkeser

The contents of this repository are distributed under the MIT license. See below for details:

The MIT License (MIT)

Copyright (c) 2020- David Benkeser

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


benkeser/drord documentation built on May 22, 2021, 6:42 a.m.