Analyses

Loglinear analysis

Model the counts in a contingency table.

Edit on GitHub

When to use it

Use loglinear analysis when you have two or more categorical variables and you want a model of the cell counts, not a single chi-square. A saturated model fits every cell. An independence model says the variables are unrelated.

Assumptions

Cells should not be mostly empty. Tensr stores sparse_cell_fraction. The saturated model has no residual degrees of freedom, so its likelihood-ratio chi-square is 0 and its comparison p is empty.

Running it in Tensr

Analyze → Loglinear → General. In chat: “Loglinear model of gender by region.”
Select at least two categorical columns. Model starts at saturated.

Options

Prop

Type

Reading the output

Teaching method and time of day. The independence model. Time was balanced inside each method, so the two factors were not built to be associated.

CellObservedExpected
Lecture, Afternoon1616
Lecture, Morning1616
Online, Afternoon1616
Online, Morning1616
Workshop, Afternoon1616
Workshop, Morning1616

Every teaching method × time cell has the same count, and the independence model expects that same count. Goodness-of-fit p = > .999. Method and time of day are not associated. The coefficient rows for this balanced table are numerical zeros, so use the cell table and the fit p.

Reporting (APA 7)

An independence loglinear model fit the method × time table, p = > .999, N = 96. Teaching method and time of day were not associated.

Coming from SPSS

Analyze → Loglinear → General. The route is on the Analyze menu.