Sample Size Calculations for Epidemiological, Clinical, and Diagnostic Studies

Provides comprehensive methods for sample size determination for epidemiological studies, clinical trials, diagnostic accuracy studies, and diagnostic agreement studies. The package supports prevalence surveys, cluster prevalence studies, unmatched case-control studies, cohort studies, superiority, non-inferiority, and equivalence clinical trials, diagnostic sensitivity, diagnostic specificity, receiver operating characteristic (ROC) area under the curve (AUC), and diagnostic agreement studies. Functions include optional adjustments for finite population correction, design effect, unequal allocation, anticipated response rate, and dropout. Results are returned as standardized 'SampleSizeR' objects with print, summary, plot, and data frame methods.


SampleSizeR

R-CMD-check CRAN status

Overview

SampleSizeR is an R package for sample size determination in epidemiological, clinical, and diagnostic research. The package provides easy-to-use functions for commonly used study designs while automatically accounting for finite population correction, design effect, response rate, and anticipated dropout.

The package returns standardized S3 objects with methods for printing, summarizing, plotting, and exporting results.


Installation

From CRAN

install.packages("SampleSizeR")

Development version

install.packages("remotes")

remotes::install_github("vinodhpmd/SampleSizeR")

Implemented Study Designs

Epidemiological Studies

  • Cross-sectional prevalence studies
  • Cluster prevalence studies
  • Cohort studies
  • Case-control studies

Clinical Trials

  • Parallel clinical trials
  • Superiority trials
  • Non-inferiority trials
  • Equivalence trials

Diagnostic Studies

  • Diagnostic sensitivity
  • Diagnostic specificity
  • ROC AUC studies
  • Diagnostic agreement studies

Features

  • Confidence interval based calculations
  • Power-based sample size estimation
  • Finite population correction
  • Cluster design effect adjustment
  • Response rate adjustment
  • Dropout adjustment
  • Publication-ready summaries
  • Built-in plotting methods
  • Data frame conversion

Example 1: Prevalence Study

library(SampleSizeR)

result <- ss_prevalence(
  prevalence = 0.20,
  precision = 0.05,
  conf.level = 0.95
)

print(result)
summary(result)
plot(result)

Example 2: Cohort Study

cohort <- ss_cohort(
  p0 = 0.15,
  risk.ratio = 2,
  power = 0.80
)

summary(cohort)

Example 3: Diagnostic Sensitivity

diag <- ss_diagnostic_sensitivity(
  sensitivity = 0.90,
  prevalence = 0.20,
  precision = 0.05
)

diag

Output

All functions return a SampleSizeR object.

class(result)

[1] "SampleSizeR"

Supported methods

print(result)

summary(result)

plot(result)

as.data.frame(result)

Documentation

help(package = "SampleSizeR")

or

?ss_prevalence

Citation

If you use SampleSizeR in published research, please cite:

Vinodh Kumar OR (2026).

SampleSizeR: Sample Size Determination for Epidemiological, Clinical and Diagnostic Studies.


Bug Reports

Please report bugs and feature requests at

https://github.com/vinodhpmd/SampleSizeR/issues


License

GPL-3

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("SampleSizeR")

0.1.0 by Vinodh Kumar Obli Rajendran, 2 months ago


https://github.com/vinodhpmd/SampleSizeR


Report a bug at https://github.com/vinodhpmd/SampleSizeR/issues


Browse source code at https://github.com/cran/SampleSizeR


Authors: Vinodh Kumar Obli Rajendran [aut, cre] , Keerthi Aaradhana [aut]


Documentation:   PDF Manual  


GPL-3 license


Imports stats, ggplot2, rlang

Suggests testthat, knitr, rmarkdown, covr


See at CRAN