Generalized linear models

Generalized linear models without the glm() call

Logistic and Poisson regression are special cases of a single framework: the generalized linear model. When your outcome is a proportion, a positive continuous quantity, or shows more variance than the model assumes, the GLM dialog lets you set the family and the link yourself and read the same output R's glm would print.

The honest part

One framework, chosen deliberately

A generalized linear model has three parts: a distribution for the outcome (the family), a function that links its mean to the predictors (the link), and a linear predictor. Choose the family and the link and you have described your model. Magic Stat offers the Gaussian, Poisson, binomial, Gamma and inverse-Gaussian families, plus the two quasi families used when you do not want to commit to a full likelihood.

The link defaults to the canonical one for each family — the identity for Gaussian, the log for Poisson, the logit for binomial — which mirrors R's behaviour and is usually the right starting point. You can change it, but the canonical link is the one with the cleanest statistical properties.

The binomial family covers two cases at once: a 0/1 outcome, or a proportion when you supply the number of trials as a weight. The quasi families estimate a dispersion parameter instead of fixing it at one, which is the standard response to overdispersion — and they carry no AIC, because a quasi-likelihood is not a true likelihood. Removing that number is deliberate.

What it does

What Magic Stat gives you for GLMs

How it works

Pick a family, pick a link

  1. Load the data. the outcome and predictors as columns.
  2. Choose Generalized Linear Model. Statistics → Regression Models → Generalized Linear Model (GLM).
  3. Set family and link. the canonical link is selected for you when the family changes.
  4. Select predictors and any weights. numeric and categorical predictors; weights for binomial proportions.
  5. Read and export. coefficients, deviance and fitted values, then the analysis goes into the report.
Options

The families and links, listed plainly

Gaussian: identity · log · inverse.

Poisson: log · identity · sqrt.

Binomial: logit · probit · cloglog · log.

Gamma: inverse · log · identity. Inverse-Gaussian: 1/mu² · inverse · log · identity.

Quasi: quasi-Poisson (log · identity) and quasi (identity · log · inverse), which estimate a dispersion parameter and carry no AIC.

Frequently asked

GLM questions, answered honestly

How do I choose a family?

From the outcome: counts use Poisson, proportions and 0/1 use binomial, a positive continuous quantity uses Gamma or inverse-Gaussian. Start with the canonical link and check the deviance and dispersion before trying alternatives.

When is this better than the logistic or Poisson dialogs?

Those dialogs are shortcuts for the two most common cases and are the right place to start. Use the GLM dialog when you need a different family, a different link, or a quasi family for overdispersion.

What does a quasi family do?

It keeps the mean–variance relationship of Poisson or Gaussian but estimates a dispersion parameter instead of fixing it at one, which widens the standard errors when the data are overdispersed. It has no AIC because the quasi-likelihood is not a true likelihood.

How do I model a proportion?

Use the binomial family with the number of trials supplied as a weight column. The outcome is then the proportion, and the weights tell the model how many trials each proportion came from.

Do I need R?

No. The fit follows the same IRLS algorithm and convergence rule as R's glm. For extensions such as negative binomial, zero-inflation, GAMs or mixed models, use the dedicated Magic Stat analyses or R.

Poisson regression → Logistic regression → GAM analysis →