Examples

K. Nathaniel Tucker edited this page Sep 30, 2017 · 84 revisions

This wiki page assembles a collection "official" and user-contributed examples, tutorials and recipes for statsmodels.

Official examples

A set of notebook examples are provided as part of the official Statsmodels documentation.

User contributions

If you have an interesting example, or if you can write a quick tutorial describing one of statsmodels' features, please consider posting it here. We would be delighted!

Feel free to post your example file in any of the common formats (e.g. .py, .rst, .html) and to use any hosting service you like. One very slick, free, and convenient alternative is to:

  1. Write-up your example in an IPython notebook
  2. Save the content of the .ipynb file in a Gist
  3. Use nbviewer to display the notebook in html format on the web. This step simply involves swapping the domain name in the Gist URL (e.g. https://gist.github.com/3484337 -> http://nbviewer.ipython.org/3484337)

Please post your contributions below!

User-contributed examples

Multiple testing and False Discovery Rates

Predictive modeling

Dotplots (forest plots)

Principal Component Analysis

Regularized model fitting

Generalized Linear Models

Scatterplot smoothing (lowess)

  • Cross sectional smoothing of NHANES data HTML View

Mediation analysis

Survival analysis

Covariance matrix estimation

  • Simulation study using "corr_nearest" HTML View

Linear Mixed Models

Generalized Estimating Equations (GEE)

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.