knitr::opts_chunk$set(
  echo = TRUE, 
  warning = FALSE, 
  message = FALSE, 
  cache = FALSE
)

Zachary McCaw
Updated: 2020-10-20

Overview

Given stratified binary event data for two arms, this package calculates summary statistics comparing two arms with respect to the marginal event rate. Marginal event rates are calculated as the stratum-size weighted-average of the per-stratum event rates, then compared via the risk difference, risk ratio, and odds ratio. Also see:

Installation

devtools::install_github(repo = 'zrmacc/MargRates')

Example

Consider the following 28-day unadjusted mortality data from a recent COVID-19 clinical trial, stratified by respiratory support at randomization

# Event counts.
y0 <- c(283, 682, 145)
n0 <- c(683, 2604, 1034)
y1 <- c(95, 298, 89)
n1 <- c(324, 1279, 501)

# Marginal Odds Ratio
library(MargRates)
set.seed(2013)
out <- CompMargRates(
  y0 = y0,
  n0 = n0,
  y1 = y1,
  n1 = n1,
  alpha = 0.05,
  boot = TRUE,
  perm = TRUE,
  reps = 2e3
)
show(out)


zrmacc/MargRates documentation built on Jan. 1, 2021, 1:55 p.m.