Learn R Programming

outstandR (version 1.0.0)

marginal_treatment_effect: Marginal treatment effect from reported event counts

Description

Computes the relative treatment effect from aggregate-level data using event counts.

Usage

marginal_treatment_effect(ald, ref_trt = NA, comp_trt = NA, scale, family)

Value

Numeric relative treatment effect.

Arguments

ald

Aggregate-level data

ref_trt

Treatment labels reference (common; e.g. placebo)

comp_trt

Treatment labels comparator

scale

A scaling parameter for the calculation.

family

A character string specifying the family distribution (e.g., "binomial").

Examples

Run this code
ald <- data.frame(trt = c("B","C","B","C"),
                  variable = c(NA, NA, "y", "y"),
                  statistic = c("N", "N", "sum", "sum"),
                  value = c(100, 100, 50, 60))
                  
marginal_treatment_effect(ald, ref_trt = "C", comp_trt = "B",
                          scale = "log_odds", family = "binomial")

Run the code above in your browser using DataLab