How to create a log-linear contingency table?

How to create a log-linear contingency table?

Overivew LL2-way ParmConstraints LL3–way Inference Stat vsPractical 4+–WayTables Logit≡Log-linear Strategies Log-linear models (or Poisson regression) log(µ) = α +β 1x 1+β 2x 2+… +β kx k where µ = response variable = count (or rate)

Which is an explanatory variable in a log linear model?

explanatory variables) are the “responses” in the sense that we’re interested in describing the relationship between the variables. This use of “response” differs from our use in GLM. For log-linear models, the response variable are the cell frequencies (counts) in the contingency table.

How to write a 2 way contingency table?

Review of notations for 2-way Contingency tables: ◮I = the number of rows. ◮J= the number of columns. ◮I×J contingency table. ◮N= IJ= the number of cells in the table. ◮n= the number of subjects (respondents, objects, etc.) cross-classified by 2 discrete (categorical) variables.

How are linear models used in a GLM?

◮Log-linear models are used to model the association (or interaction structure) between/among categorical variables. ◮The categorical variables (which in GLM terminology are explanatory variables) are the “responses” in the sense that we’re interested in describing the relationship between the variables.

What are the variables in a loglinear model?

All variables in a loglinear model are essentially “responses”. To learn more about loglinear models, we’ll explore the following data from Agresti (1996, Table 6.3). It summarizes responses from a survey that asked high school seniors in a particular city whether they had ever used alcohol, cigarettes, or marijuana.

How are cell counts used in a loglinear model?

Loglinear models model cell counts in contingency tables. They’re a little different from other modeling methods in that they don’t distinguish between response and explanatory variables. All variables in a loglinear model are essentially “responses”.

Which is the log linear model for expected counts?

In terms of the systematic structure of the model, we could consider three log-linear models for the expected counts: the null model, the additive model and the saturated model. The null model would assume that all four kinds of patients arrive at the hospital or health center in the same numbers.