A toolkit for Development, Validation, and Updating of Clinical Prediction Models.
A toolkit designed for calculating minimum sample sizes in clinical prognostic research. Developed for data scientists, statisticians, and clinical researchers, this application implements validated statistical methods for Prediction Model Development, External Validation, Prognostic Factor Studies, and Model Updating.
🔗 Live Application: https://pmsample.streamlit.app/
Note: Partial support for Chinese, Japanese, French, and German added via AI. Please contact the app admin for any questions.
This application provides a suite of tools to address the complex requirements of sample size planning in medical research. Unlike basic power calculators, this tool focuses on the specific nuances of prognostic modeling, where the goal is often accurate estimation of risk (calibration and discrimination) rather than simple hypothesis testing.
- Methodological: Implements algorithms strictly adhering to peer-reviewed statistical literature (Riley et al., Hanley & McNeil, Hsieh, et al.).
-
Validation: Core calculations have been verified against established R packages (
pmsampsize,presize,pmvalsampsize,sampsizeval) to ensure accuracy. - Bilingual Ecosystem: Fully localized for English and Vietnamese, facilitating international collaboration.
-
Sensitivity Analysis: Integrated batch processing allows researchers to evaluate how sample size requirements vary across a range of assumptions (e.g., varying prevalence or anticipated
$R^2$ ).
The application is structured into four primary modules, each targeting a specific phase of the research lifecycle.
| Method | Description |
|---|---|
| A1.1: Rules of Thumb (EPV) | Heuristic check (events per variable). |
| A1.2: Baseline Risk Precision | Sample size for estimating prevalence (CI width). |
| Method | Description |
|---|---|
| A2.1: Logistic Power (Hsieh) | Power to detect an OR for a single predictor. |
| A2.2: Cox Power (Schoenfeld) | Power to detect a HR for a single predictor. |
| Method | Description |
|---|---|
| A3.1: Riley et al. (Analytical) | Gold Standard. Development sample size for overfitting & precision. |
| A3.2: Development Simulation | Simulation-based planning for complex models (DGM). |
| A3.3: Bayesian Assurance | MCMC-based assurance for Bayesian models. |
| Method | Description |
|---|---|
| A4.1: AUC Precision | Sample size for AUC CI width (Hanley-McNeil). |
| A4.2: External Validation (Tailored) | Target calibration and discrimination precision (Riley/Snell). |
| A4.3: Ext. Validation (Simulation) | Simulation-based validation planning (LP distribution). |
| A4.4: Model Updating | Sample size for recalibrating intercept/slope. |
| Method | Description |
|---|---|
| B1: Green's Rule | Heuristic for linear regression (50 + 8k). |
| B2: Riley et al. (Continuous) | Analytical method for linear regression (residuals). |
| Method | Description |
|---|---|
| C1: Riley et al. (Survival) | Analytical method for Cox models (time-to-event). |
To deploy this application within your own infrastructure:
Repositories:
- GitLab (Primary):
gitlab.com/minhthiennguyen/pmsample - GitHub (Mirror):
github.com/nguyenminh2301/pmsample
- Python 3.9+
- Git
-
Clone the Repository
git clone https://github.com/nguyenminh2301/pmsample.git cd pmsample -
Environment Setup It is highly recommended to use a virtual environment.
python -m venv .venv # Windows: .venv\Scripts\activate # macOS/Linux: source .venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Launch Application
streamlit run pmsampsize_app/app.py
For Academic and Research Use Only.
This software is an implementation of statistical methods published in peer-reviewed literature. While every effort has been made to ensure the accuracy of the algorithms, the authors and maintainers assume no liability for the design or results of any study based on this tool.
- User Responsibility: Users are responsible for verifying the input parameters and interpreting the results within the context of their specific clinical domain.
- No Clinical Warranty: This tool does not provide medical advice.
If you use this tool in your research, please cite it as follows:
Nguyen, Minh. (2025). Prognostic Research Sample Size Tool (Version 1.0) [Software]. Available at https://pmsample.streamlit.app/
Or use the BibTeX entry:
@software{nguyen2025pmsample,
author = {Nguyen, Minh},
title = {Prognostic Research Sample Size Tool},
year = {2025},
url = {https://pmsample.streamlit.app/},
version = {1.0}
}Author & Maintainer: Minh Nguyen MPH (Mr/ He/ him) email: minhnt@ump.edu.vn Department of Epidemiology, Faculty of Public Health, University of Medicine and Pharmacy at Ho Chi Minh City, Vietnam