Python script constructing regression design matrices from model formulas with patsy and statsmodels. Reusable statistical-modelling example.
sm_design_matrices.py
Python 3 with numpy, pandas, patsy, statsmodels.
pip install numpy pandas patsy statsmodels
Polina Lemenkova — ORCID: https://orcid.org/0000-0002-5759-1089
Archived code: https://doi.org/10.13140/RG.2.2.14575.89764
MIT — see the LICENSE file (Copyright Polina Lemenkova).