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.
install.packages("SampleSizeR")install.packages("remotes")
remotes::install_github("USERNAME/SampleSizeR")- Cross-sectional prevalence studies
- Cluster prevalence studies
- Cohort studies
- Case-control studies
- Parallel clinical trials
- Superiority trials
- Non-inferiority trials
- Equivalence trials
- Diagnostic sensitivity
- Diagnostic specificity
- ROC AUC studies
- Diagnostic agreement studies
- 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
library(SampleSizeR)
result <- ss_prevalence(
prevalence = 0.20,
precision = 0.05,
conf.level = 0.95
)
print(result)
summary(result)
plot(result)cohort <- ss_cohort(
p0 = 0.15,
risk.ratio = 2,
power = 0.80
)
summary(cohort)diag <- ss_diagnostic_sensitivity(
sensitivity = 0.90,
precision = 0.05
)
diagAll functions return a SampleSizeR object.
class(result)
[1] "SampleSizeR"Supported methods
print(result)
summary(result)
plot(result)
as.data.frame(result)help(package = "SampleSizeR")or
?ss_prevalenceIf you use SampleSizeR in published research, please cite:
Vinodh Kumar OR (2026).
SampleSizeR: Sample Size Determination for Epidemiological, Clinical and Diagnostic Studies.
Please report bugs and feature requests at
https://github.com/USERNAME/SampleSizeR/issues
GPL-3