Skip to contents

Usage

costeffectiveness(
  data,
  strategy,
  comparator_level,
  cost,
  effectiveness,
  effectiveness_type = "binary",
  effectiveness_label = "Correct Diagnoses",
  calculate_icer = TRUE,
  calculate_incremental = TRUE,
  dominance_analysis = FALSE,
  net_monetary_benefit = FALSE,
  wtp_threshold = 50000,
  multiple_wtp_thresholds = FALSE,
  wtp_range = "0, 25000, 50000, 100000, 150000",
  confidence_intervals = FALSE,
  ci_method = "bootstrap",
  bootstrap_samples = 1000,
  confidence_level = 0.95,
  deterministic_sensitivity = FALSE,
  sensitivity_parameters =
    "test_cost, follow_up_cost, test_sensitivity, test_specificity",
  sensitivity_range_pct = 20,
  probabilistic_sensitivity = FALSE,
  psa_simulations = 1000,
  cost_distribution = "gamma",
  effect_distribution = "normal",
  voi_analysis = FALSE,
  evpi_population = 10000,
  evppi_parameters = FALSE,
  evppi_focus = "both",
  subgroup_analysis = FALSE,
  subgroup_variable,
  time_horizon = 1,
  discount_costs = FALSE,
  discount_rate_costs = 3,
  discount_effects = FALSE,
  discount_rate_effects = 3,
  plot_ce_plane = TRUE,
  plot_ce_acceptability = FALSE,
  plot_nmb = FALSE,
  plot_tornado = FALSE,
  plot_incremental_frontier = FALSE,
  perspective = "healthcare",
  include_indirect_costs = FALSE,
  currency = "USD",
  cost_year = 2024,
  handling_missing = "complete",
  random_seed = 12345
)

Arguments

data

The data as a data frame.

strategy

Variable indicating which diagnostic strategy was used for each observation. Should have at least 2 levels (e.g., "New Test" vs. "Standard Care").

comparator_level

Which level of strategy variable represents the comparator (baseline/reference) strategy against which others are compared.

cost

Total cost per patient for the diagnostic strategy. Should include all relevant costs: test costs, follow-up procedures, treatment costs, adverse events. Express in consistent currency units (e.g., USD, EUR).

effectiveness

Effectiveness measure per patient. Can be correct diagnoses (0/1), QALYs, life-years gained, cancers detected, etc. Higher values should represent better outcomes.

effectiveness_type

Type of effectiveness measure being analyzed. Affects interpretation and labeling of ICER results.

effectiveness_label

Custom label for effectiveness measure (e.g., "Cancers Detected", "True Positives", "QALYs").

calculate_icer

Calculate Incremental Cost-Effectiveness Ratio. ICER = (Cost_new - Cost_comparator) / (Effect_new - Effect_comparator). Represents additional cost per additional unit of effectiveness.

calculate_incremental

Display incremental costs and effects relative to comparator strategy.

dominance_analysis

Identify dominated strategies (more costly and less effective) and extended dominance (strategies on inefficient frontier).

net_monetary_benefit

Calculate Net Monetary Benefit (NMB) at specified willingness-to-pay thresholds. NMB = (Effectiveness × WTP) - Cost. Positive NMB indicates cost-effective at that threshold.

wtp_threshold

Willingness-to-pay threshold for primary analysis (e.g., $50,000 per QALY in US, £20,000-30,000 per QALY in UK). Used for net benefit calculation.

multiple_wtp_thresholds

Evaluate cost-effectiveness at multiple willingness-to-pay thresholds to show robustness of conclusions.

wtp_range

Comma-separated list of willingness-to-pay thresholds for analysis. Example: "0, 20000, 30000, 50000, 100000".

confidence_intervals

Calculate confidence intervals for mean costs, mean effects, and ICER using bootstrap or parametric methods.

ci_method

Method for confidence interval estimation. Bootstrap is recommended for cost data (often skewed). BCa (Bias-Corrected Accelerated) provides better coverage for skewed distributions.

bootstrap_samples

Number of bootstrap resamples for confidence interval estimation.

confidence_level

Confidence level for interval estimation.

deterministic_sensitivity

One-way sensitivity analysis varying individual parameters to assess impact on ICER. Creates tornado diagram showing most influential parameters.

sensitivity_parameters

Comma-separated list of parameter names for deterministic sensitivity analysis. These should be column names in the data.

sensitivity_range_pct

Percentage variation around base case for sensitivity analysis. For example, 20\ 120\

probabilistic_sensitivityMonte Carlo simulation to propagate uncertainty in all parameters simultaneously. Generates cost-effectiveness acceptability curve (CEAC) showing probability of cost-effectiveness at different WTP thresholds.

psa_simulationsNumber of Monte Carlo simulations for probabilistic sensitivity analysis.

cost_distributionProbability distribution for cost parameter uncertainty. Gamma is recommended for costs (non-negative, often right-skewed).

effect_distributionProbability distribution for effectiveness parameter uncertainty. Beta is recommended for proportions, normal for continuous measures.

voi_analysisCalculate Expected Value of Perfect Information (EVPI) to quantify the expected cost of uncertainty in the decision. EVPI represents the maximum value of conducting further research to eliminate all parameter uncertainty.

evpi_populationPopulation size affected by the decision over the relevant time horizon. EVPI is calculated per-person and then multiplied by population to give total value of eliminating uncertainty.

evppi_parametersCalculate Expected Value of Perfect Parameter Information (EVPPI) for specific parameters. Shows which parameters contribute most to decision uncertainty.

evppi_focusWhich parameters to include in EVPPI calculation. Useful for identifying whether cost or effectiveness uncertainty drives decision uncertainty.

subgroup_analysisPerform cost-effectiveness analysis stratified by subgroups to identify populations where new strategy is most cost-effective.

subgroup_variableVariable defining subgroups for stratified analysis (e.g., disease stage, age group, risk category).

time_horizonTime horizon for cost-effectiveness analysis in years. Short-term for diagnostic tests (1 year), longer for treatments affecting survival.

discount_costsApply discounting to future costs (relevant for multi-year time horizons).

discount_rate_costsAnnual discount rate for future costs (typically 3-5\discount_effectsApply discounting to future health effects (QALYs, life-years).discount_rate_effectsAnnual discount rate for future effects (often same as cost discount rate).plot_ce_planeScatter plot showing incremental costs (y-axis) vs. incremental effects (x-axis). Quadrants indicate dominance relationships. Willingness-to-pay threshold shown as diagonal line.plot_ce_acceptabilityCEAC showing probability that each strategy is cost-effective across range of willingness-to-pay thresholds. Requires probabilistic sensitivity analysis.plot_nmbBar plot showing net monetary benefit for each strategy at specified WTP threshold. Strategy with highest NMB is optimal.plot_tornadoTornado diagram showing one-way sensitivity analysis results. Parameters ordered by impact on ICER, showing range of ICER values across parameter uncertainty ranges.plot_incremental_frontierPlot showing efficient frontier connecting non-dominated strategies.perspectivePerspective for cost-effectiveness analysis determines which costs are included. Healthcare system includes direct medical costs, societal includes productivity losses and patient time costs.include_indirect_costsInclude indirect costs (productivity losses, patient time) for societal perspective.currencyCurrency for cost reporting (e.g., USD, EUR, GBP, JPY).cost_yearReference year for cost values (for inflation adjustment if needed).handling_missingMethod for handling missing cost or effectiveness data.random_seedRandom seed for bootstrap and Monte Carlo simulations. A results object containing:

results$instructionsa html
results$strategySummarySummary statistics for each diagnostic strategy
results$incrementalAnalysisIncremental costs, effects, and ICER relative to comparator
results$netBenefitNet monetary benefit at specified WTP thresholds
results$multipleWTPNMB and optimal strategy across WTP range
results$dominanceTableIdentification of dominated and extendedly dominated strategies
results$subgroupCEAICER by subgroup
results$sensitivityAnalysisImpact of individual parameter variation on ICER
results$psaSummaryMonte Carlo simulation results
results$voiSummaryExpected value of perfect information analysis
results$evppiTableValue of information by parameter group
results$cePlanePlotIncremental costs vs. incremental effects scatter plot
results$ceAcceptabilityCurveProbability of cost-effectiveness across WTP thresholds
results$nmbPlotNMB comparison at specified WTP threshold
results$tornadoPlotOne-way sensitivity analysis results
results$incrementalFrontierPlotEfficient frontier showing non-dominated strategies
results$interpretationa html
Tables can be converted to data frames with asDF or as.data.frame. For example:results$strategySummary$asDFas.data.frame(results$strategySummary) Cost-Effectiveness Analysis (CEA) for evaluating the economic value of diagnostic tests, screening programs, and clinical decision strategies. Calculates Incremental Cost-Effectiveness Ratio (ICER), which represents the additional cost per additional unit of effectiveness (e.g., cost per correct diagnosis, cost per QALY gained). The analysis compares new diagnostic strategies against standard of care or alternative approaches, visualizing results on the cost-effectiveness plane and calculating net monetary benefit at various willingness-to-pay thresholds. Essential for health technology assessment, budget impact analysis, and justifying adoption of new diagnostic technologies such as multiplex IHC, AI-assisted pathology, digital pathology platforms, and molecular tests. Supports deterministic sensitivity analysis (tornado plots) to identify key cost drivers and probabilistic sensitivity analysis (Monte Carlo simulation) to quantify uncertainty in cost-effectiveness conclusions. Particularly valuable for demonstrating value proposition of advanced diagnostics to hospital administrators, payers, and policy makers. result <- costeffectiveness( data = diagnostic_study, strategy = "test_strategy", cost = "total_cost", effectiveness = "correct_diagnoses", comparator = "standard_care" )