Skip to contents

Analyzes how diagnostic accuracy changes when applying two tests in sequence, comparing three different testing strategies: serial positive (confirmation), serial negative (exclusion), and parallel testing. Provides comprehensive analysis including population flow, cost implications, and Fagan nomograms.

Usage

sequentialtests(
  preset = "custom",
  test1_name = "Screening Test",
  test1_sens = 0.95,
  test1_spec = 0.7,
  test2_name = "Confirmatory Test",
  test2_sens = 0.8,
  test2_spec = 0.98,
  strategy = "serial_positive",
  prevalence = 0.1,
  show_explanation = TRUE,
  show_formulas = FALSE,
  show_nomogram = FALSE
)

Arguments

preset

Select a clinical preset or use custom values. Presets load evidence-based test parameters and optimal strategies from medical literature.

test1_name

.

test1_sens

.

test1_spec

.

test2_name

.

test2_sens

.

test2_spec

.

strategy

.

prevalence

.

show_explanation

.

show_formulas

.

show_nomogram

.

Value

A results object containing:

results$summary_tablea table
results$individual_tests_tablea table
results$population_flow_tablea table
results$explanation_texta html
results$formulas_texta html
results$plot_flow_diagraman image
results$plot_performancean image
results$plot_probabilityan image
results$plot_population_flowan image
results$clinical_guidancea html

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$summary_table$asDF

as.data.frame(results$summary_table)

Details

This analysis is particularly useful for: • Designing diagnostic protocols and clinical pathways • Optimizing test sequencing for specific clinical contexts • Understanding trade-offs between sensitivity and specificity • Evaluating cost-effectiveness of different testing strategies • Teaching sequential testing concepts and Bayesian probability

Examples

# COVID-19 testing: Rapid antigen followed by RT-PCR confirmation
# Shows how serial positive strategy improves specificity
data(sequential_testing_examples)
#> Warning: data set ‘sequential_testing_examples’ not found
covid_example <- sequential_testing_examples[
  sequential_testing_examples$scenario == "COVID-19 Testing" &
  sequential_testing_examples$clinical_setting == "Community screening", ]
#> Error: object 'sequential_testing_examples' not found

# Cancer screening: Mammography followed by tissue biopsy
# Demonstrates cost-effective screening with definitive diagnosis
breast_cancer <- sequential_testing_examples[
  sequential_testing_examples$scenario == "Breast Cancer Screening", ]
#> Error: object 'sequential_testing_examples' not found

# Emergency medicine: Parallel testing for rapid diagnosis
# Shows how parallel strategy maximizes sensitivity
emergency_example <- sequential_testing_examples[
  sequential_testing_examples$scenario == "Myocardial Infarction Rule-out", ]
#> Error: object 'sequential_testing_examples' not found

# Strategy comparison across different prevalence settings
data(strategy_comparison)
#> Warning: data set ‘strategy_comparison’ not found

# Cost-effectiveness analysis for resource planning
data(cost_effectiveness_examples)
#> Warning: data set ‘cost_effectiveness_examples’ not found

# Load example datasets for realistic clinical scenarios
data(sequential_testing_examples)  # 15+ clinical scenarios across specialties
#> Warning: data set ‘sequential_testing_examples’ not found
data(strategy_comparison)          # Strategy performance comparisons
#> Warning: data set ‘strategy_comparison’ not found
data(cost_effectiveness_examples)  # Economic analysis examples
#> Warning: data set ‘cost_effectiveness_examples’ not found
data(teaching_examples)            # Educational scenarios
#> Warning: data set ‘teaching_examples’ not found
data(common_test_combinations)     # Reference test characteristics
#> Warning: data set ‘common_test_combinations’ not found