Download the PHP package touilelhadj/biostat-php without Composer
On this page you can find all versions of the php package touilelhadj/biostat-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download touilelhadj/biostat-php
More information about touilelhadj/biostat-php
Files in touilelhadj/biostat-php
Package biostat-php
Short Description A pure-PHP biostatistics library implementing descriptive, bivariate and multivariate methods (logistic regression, VIF, Box-Tidwell, GLMM by PQL, GEE with Liang-Zeger sandwich variance, MICE multiple imputation, Rubin's pooling) for survey-based epidemiological studies.
License MIT
Homepage https://github.com/Touil-Elhadj/biostat-php
Informations about the package biostat-php
biostat-php
A pure-PHP biostatistics library implementing descriptive, bivariate and multivariate methods for survey-based epidemiological studies — including logistic regression, VIF, Box–Tidwell, GLMM, GEE, MICE and Rubin's pooling.
📖 Overview
biostat-php brings the analytic side of a cross-sectional epidemiological
study to PHP. It implements, in pure PHP and without external
dependencies, the same family of statistical methods normally available
only in R (stats, car, lme4, geepack, mice) or SPSS.
The library was extracted from a real research instrument — a trilingual data-collection platform used to study adolescent overweight in the Wilaya of Chlef, Algeria — where it ran the 48 pre-registered hypotheses of the underlying master thesis on a low-cost shared-hosting environment that did not allow R or Python.
Every method is cross-checked against R 4.x and IBM SPSS 25; the
quantitative comparison is documented in
docs/validation-tables.md and exercised by
the PHPUnit suite in tests/.
🚀 Installation
Requirements:
- PHP ≥ 8.0
- No external PHP extension beyond the defaults (
mbstring,jsononly for the test fixtures) - No system library, no Composer dependency at runtime
⚡ Quick start
More examples — including GLMM and MICE — are in examples/.
A complete per-method walkthrough with R-equivalent commands is in
docs/usage-examples.md.
🧪 Method catalogue
| Family | Methods |
|---|---|
| Descriptive | mean, std, median, quantile |
| 2 × 2 tables | chi2Test2x2 (with Yates), oddsRatio (with Haldane–Anscombe) |
| Means | tTest (Welch), anova |
| Correlation | pearson, spearman |
| Binomial | binomialTest |
| Logistic regression | logisticRegression, logisticRegressionMulti, hosmerLemeshow |
| Multiple testing | benjaminiHochberg (FDR) |
| Multicollinearity | vif |
| Logit linearity | boxTidwell |
| Mixed / clustered | glmmLogistic (PQL), geeLogistic (Liang–Zeger sandwich) |
| Missing data | mice (PMM + chained Gibbs), rubinPool (Rubin's rules) |
Mathematical formulations and bibliographic references for every method
are in docs/statistical-methods.md.
✅ Verification
Reference values for every method were computed independently in R 4.3.0 and IBM SPSS 25. The tolerances used in the test suite are:
| Family | Tolerance |
|---|---|
| p-values | ± 0.01 |
| Odds ratios | ± 0.01 |
| Correlation coefficients | ± 0.001 |
| Regression coefficients | ± 0.05 |
| Variance components (GLMM) | ± 0.05 |
A complete numerical comparison table — R command, R value, PHP value,
|Δ| — lives in docs/validation-tables.md.
🧰 Running the tests
📁 Repository layout
📚 Citation
If you use this library in a research publication, please cite it. A
machine-readable citation file is provided in
CITATION.cff.
Recommended citation
TOUIL, E. (2026). biostat-php: a pure-PHP biostatistics library for survey-based epidemiological studies. Version 1.0.0. https://github.com/Touil-Elhadj/biostat-php
BibTeX
🌍 Real-world use
biostat-php is the analytic engine of the
chlef-touilelhadj
platform, a trilingual web instrument used to enrol 1 220 adolescents
(14–19 years) in the Wilaya of Chlef, Algeria, during the 2025–2026
academic year. All statistical results of the underlying master thesis
were produced by this library and independently verified against R 4.x
and SPSS 25.
🤝 Contributing
Contributions are welcome — see CONTRIBUTING.md for
the development workflow and the statistical-contribution checklist
(every new method must ship with a closed-form reference value from R
or SPSS plus a PHPUnit assertion).
🛡 Security
To report a vulnerability please follow the procedure in
SECURITY.md.
📄 License
Released under the MIT License — © 2026 TOUIL Elhadj.