Design Matrices using Patsy in Python @DrJuanKlopper
Design Matrices using Patsy in Python  @DrJuanKlopper
Uploaded April 2021 | Updated September 2026, 1 week ago
I am Dr Juan Klopper, Surgeon and Research Fellow as the School for Data Science and Computational Thinking at Stellenbosch University. If you want to learn how to use python for healthcare statistics consider, my course and get a certificate from my research group. The course is available at udemy.com/course/biostatistics-fundamentals-using-python For more course visit juanklopper.com

The files for this tutorial will be made available on GitHub soon.

In this video tutorial I discuss the preparation of tabular data for use in statistical python packages such as statsmodels. The patsy package is ideal for creating design matrices that can be used in statsmodels.

Design matrices in models include the dependent vector and the matrix of independent variables. Functions in patsy can generate these from tabular data. The patsy package can also preprocess the data. It can, for instance, generate design matrices with interaction terms, add new variables to a feature matrix, transform the values of a variable, and many other such transformation.
Design Matrices using Patsy in PythonDihedral group exampleSolve cubic equation Lecture 8 Review of AlgebraPropositional logic in abstract algebraHow to extract COVID-19 info from JHU data using RPandas tutorial for beginnersIntroduction to PythonGram-Schmidt orthogonalization and Legendre Polynomials using the Wolfram LanguageRegularization in deep learningThe Wolfram Language computational essay for anatomyData transformation using the Wolfram LanguageHistograms using Plotly for R
Dr Juan Klopper |

Design Matrices using Patsy in Python

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER