Generalized Linear Models in IronPython QuickStart Sample

Illustrates how to use the GeneralizedLinearModel class to compute probit, Poisson and similar regression models in IronPython.

This sample is also available in: C#, Visual Basic, F#.

Overview

This QuickStart sample demonstrates how to use generalized linear models (GLM) in Numerics.NET to analyze relationships between variables with non-normal distributions.

The sample walks through two complete examples:

  1. A Poisson regression analyzing student attendance data to examine relationships between absences and factors like math scores, language arts scores, and gender. This demonstrates handling count data using the canonical link function.

  2. A probit regression analyzing graduate school admissions data to model the probability of admission based on GRE scores, GPA, and school ranking. This shows how to work with binary outcome data using the probit link function.

For each example, the code shows how to:

  • Load and prepare the data
  • Specify the model family and link function
  • Fit the model
  • Extract and interpret parameter estimates, standard errors, and p-values
  • Calculate confidence intervals
  • Obtain model fit statistics like log likelihood and information criteria

The sample includes detailed comments explaining each step and interpreting the results, making it an excellent introduction to generalized linear modeling in Numerics.NET.

The code

Coming soon...