Skip to contents

Format

A data frame with 8 rows and 7 variables:

prevalence

Disease prevalence (0.05 to 0.90)

sensitivity

Target sensitivity value

specificity

Target specificity value

ci_width

Desired 95\ n_sens_expectedExpected sample size for sensitivity (from Bujang Table 2) n_spec_expectedExpected sample size for specificity (from Bujang Table 2) n_total_expectedExpected total sample size (maximum of sens/spec)

Bujang MA (2023). An Elaboration on Sample Size Planning for Performing a One-Sample Sensitivity and Specificity Analysis by Basing on Calculations on a Specified 95\ Table 2 (pages 5-6). doi:10.3390/diagnostics13081390 bujang_table2_validation Validation dataset containing excerpts from Bujang MA (2023) Table 2 for diagnostic test sample size calculations. Used to validate Clopper-Pearson exact binomial confidence interval implementation. This dataset provides benchmark values for validating the Clopper-Pearson sample size calculation implementation. Each row represents a specific combination of prevalence, target sensitivity/specificity, and desired confidence interval width, with the expected sample sizes as published in Bujang (2023).Validation Test Cases:

  1. Prevalence 5\

  2. Prevalence 5\

  3. Prevalence 10\

  4. Prevalence 10\

  5. Prevalence 20\

  6. Prevalence 50\

  7. Prevalence 50\

  8. Prevalence 90\

UsageThese values can be used to programmatically validate that the diagnosticsamplesize module produces results consistent with Bujang's published tables.

# Load validation data data(bujang_table2_validation)# View all test cases print(bujang_table2_validation)# Test case: Low prevalence (5%), high targets (95%), narrow CI (0.10) test1 <- bujang_table2_validation[1, ] cat("Prevalence:", test1$prevalence * 100, "%") cat("Targets: Sens =", test1$sensitivity, ", Spec =", test1$specificity, "") cat("Expected total N:", test1$n_total_expected, "")# Compare low vs. high prevalence scenarios low_prev <- bujang_table2_validation[bujang_table2_validation$prevalence == 0.05, ] high_prev <- bujang_table2_validation[bujang_table2_validation$prevalence == 0.90, ]cat(" prevalence (5%) scenarios:") print(low_prev[, c("sensitivity", "specificity", "ci_width", "n_total_expected")])cat(" prevalence (90%) scenarios:") print(high_prev[, c("sensitivity", "specificity", "ci_width", "n_total_expected")]) datasets