Learn R Programming

outstandR (version 1.0.0)

marginal_variance: Marginal effect variance using the delta method

Description

Computes the total variance of marginal treatment effects using the delta method.

Usage

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

Value

Numeric total variance of marginal treatment effects.

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_variance(ald, ref_trt = "C", comp_trt = "B",
                  scale = "log_odds", family = "binomial")

Run the code above in your browser using DataLab