A curated collection of statistical methods implemented from first principles, with mathematical intuition, reproducible code, practical examples, and applications to real-world scientific problems.
Statistics is far more than a collection of tests.
Every statistical method is built upon mathematical assumptions about uncertainty, variability, dependence, and inference. Understanding these foundations is essential for applying statistical methods correctly in scientific research.
This repository is an ongoing collection of statistical methods that I have implemented, studied, or applied throughout my work in computational science, statistical genetics, biomedical research, and machine learning.
Rather than presenting statistical methods as "recipes", each tutorial aims to explain
- the underlying mathematical intuition,
- the statistical assumptions,
- implementation in R and/or Python,
- visualization,
- interpretation of results,
- practical applications,
- and common pitfalls.
The emphasis is on learning why a method works, not simply how to call a software function.
| Category | Topics |
|---|---|
| Classical Statistics | t-test, ANOVA, Chi-square Test, Fisher's Exact Test |
| Regression Models | Linear Regression, Logistic Regression, Generalized Linear Models |
| Survival Analysis | Kaplan–Meier, Cox Proportional Hazards Model |
| Mixed Models | Linear Mixed Models, Random Effects |
| Multivariate Statistics | PCA, MANOVA, PERMANOVA |
| Bayesian Statistics | Bayesian inference (planned) |
| Multiple Testing | Bonferroni, Benjamini–Hochberg |
| Resampling Methods | Bootstrap, Permutation Tests |
| Statistical Genetics | Heritability, GWAS-related methods (growing) |
| Machine Learning Statistics | ROC curves, Cross-validation, Model evaluation |
The goal of this repository is to bridge the gap between mathematical statistics and practical data analysis.
Each tutorial attempts to answer five questions:
- What problem does this method solve?
- What mathematical assumptions does it make?
- How is the method derived?
- How can it be implemented in R or Python?
- How should the results be interpreted?
Whenever possible, tutorials include
- mathematical derivations,
- intuitive explanations,
- reproducible code,
- figures,
- simulated examples,
- references to the original literature.
| Tutorial | Status |
|---|---|
| Covariance Matrix | ✅ |
| Survival Analysis | ✅ |
| PERMANOVA | ✅ |
| Statistical Tests | ✅ |
| Linear Regression | 🚧 |
| Logistic Regression | 🚧 |
| Mixed Models | 🚧 |
| Bayesian Statistics | 🚧 |
| Statistical Genetics | 🚧 |
- R
- Python
- NumPy
- SciPy
- pandas
- statsmodels
- survival
- ggplot2
- matplotlib
This repository is intended for
- Data Scientists
- Computational Biologists
- Statistical Geneticists
- Graduate Students
- Researchers
- Machine Learning Practitioners
- Anyone interested in learning statistical methods from first principles
Some topics currently planned include
- Linear Mixed Models
- Generalized Linear Mixed Models
- REML
- Bayesian Regression
- Mediation Analysis
- Structural Equation Models
- Bootstrapping
- Permutation Testing
- Multiple Testing Correction
- Meta-analysis
- Mendelian Randomization
- Polygenic Risk Scores
- GWAS Quality Control
- Heritability Estimation
- Principal Component Analysis
- Canonical Correlation Analysis
Suggestions, discussions, and corrections are always welcome.
If you notice an error, have an idea for a new tutorial, or would like to improve an existing implementation, feel free to open an issue or submit a pull request.
Nivedita Bhadra, PhD
Computational Scientist
Physics → Statistics → Machine Learning → Statistical Genetics → Biomedical Data Science
GitHub: https://github.com/BNTechie
Medium: https://medium.com/@nivedita.home
LinkedIn: https://www.linkedin.com/in/nivedita-bhadra-b5149130
This repository is released under the MIT License.