compute_nmb_ceac: Compute Net Monetary Benefit (NMB) and CEAC Table

View source: R/nmb_ceac.R

compute_nmb_ceacR Documentation

Compute Net Monetary Benefit (NMB) and CEAC Table

Description

Computes the expected Net Monetary Benefit (ENMB) and the probability of cost-effectiveness for a range of Willingness-To-Pay (WTP) thresholds. This function is useful for generating Cost-Effectiveness Acceptability Curves (CEAC).

Usage

compute_nmb_ceac(formula, data, wtp_range = seq(0, 1e+05, 1000))

Arguments

formula

A formula of the form cost + effect ~ 1, where:

  • cost is the numeric column for cost,

  • effect is the numeric column for effectiveness (e.g., QALYs). The right-hand side ~ 1 is ignored but required for consistency.

data

A data frame containing the variables used in the formula.

wtp_range

A numeric vector of WTP thresholds (e.g., seq(0, 100000, 1000)).

Value

An object of class "nmb_ceac", which is a data.frame with columns:

WTP

Willingness-to-pay threshold

ENMB

Expected Net Monetary Benefit at each WTP

Prob_CE

Probability of being cost-effective at each WTP

The object also contains the original formula as an attribute.

Examples

set.seed(123)
df <- data.frame(
  c = rnorm(100, 500, 100),
  e = rnorm(100, 0.6, 0.05)
)
ceac_tbl <- compute_nmb_ceac(c + e ~ 1, data = df, wtp_range = seq(0, 2000, 200))
summary(ceac_tbl)


ielbadisy/CEACT documentation built on June 11, 2025, 9:19 p.m.