Log-linear Model for Contingency Tables in R
Log-linear Model for Contingency Tables in R
Example in R
Here, we analyze a three-way contingency table of Hair Color, Eye Color, and Sex using the
built-in HairEyeColor dataset.
# Load dataset
data("HairEyeColor")
Explanation
Includes main effects (Hair, Eye, Sex) and two-way interactions (Hair:Eye, Hair:Sex,
Eye:Sex).
summary(log_model):