statable Statistics for study and research

How are several categories related? (log-linear models)

In brief

Are school type, gender and qualification related, and which pairs of them? A log-linear model explains the frequency of each cell of a table from main effects and interactions. Statable tests a model you choose; there is no automatic model search.

How it works in Statable

  1. "New analysis", then choose the card "How are several categories related?".
  2. "Which categories?": two to five columns that name groups. Optionally a column with the frequency per cell.
  3. The result shows G² and X²: a large p here means that the model does not contradict the data.
  4. Another model: "More options: choose the model", then "Recalculate with this model".

What the table looks like

Two to five columns with categories (2 to 12 values each). Either every row counts as one case, or a column with whole numbers gives the frequency per cell. Statable counts every cell of the table, including the empty ones; their number is shown in the result. Nothing is calculated for frequencies that are not whole numbers or are negative, and for more than 20,000 cells.

Choosing the model

Reading the result

Difference from SPSS

G² and df are the same as in SPSS. Statable does not pick a model by rules; the choice stays with you.

Requirements and limits

Reporting the result

G²(9) = 6.76, p = .662; X²(9) = 6.87

Typical examples

For specialists

R (stats): glm(frequency ~ terms, family = poisson) on the full table (expand.grid, otherwise df is wrong). G² = deviance, X² by Pearson, AIC from the model. Checked on HairEyeColor against MASS::loglm and SPSS.

Related

Open in Statable