Questions tagged [log-linear]

The log-linear model is a form of Poisson regression that allows for the analysis of multi-way contingency tables.

In Poisson regression, we can model the response using the (canonical) log link:

$$\mu(x) = e^{\alpha + \beta x}$$

In this way, we get a log-linear model:

$$\log(\mu(x)) = \alpha + \beta x$$

For an $I \times J$ contingency table sampled under the Poisson sampling scheme, with covariate dependent cell means and independent margins, we have:

$$\mu_{ij} = \mu\alpha_i\beta_j$$

With $\sum_i \alpha_i = \sum_{j} \beta_j = 1$, which can be written, under a reparameterization, as::

$$\log(\mu_{ij}) = \lambda + \lambda_i^X + \lambda _j^Y$$

Where $\lambda_i^X$ ($\alpha_i$) and $\lambda_j^Y$ ($\beta_j$) specify row and column marginal distributions given total count, and $\lambda$ specifies the mean of the total count ($\mu = \sum_{i,j} \mu_{ij}$).

Extensions of this model include interaction terms, $\lambda_{ij}^{XY}$ and other dimensions $\lambda{k}^Z$.

149 questions
46
votes
5 answers

Understanding regressions - the role of the model

How can a regression model be any use if you don't know the function you are trying to get the parameters for? I saw a piece of research that said that mothers who breast fed their children were less likely to suffer diabetes in later life. The…
22
votes
3 answers

Log-linear regression vs. logistic regression

Can anyone provide a clear list of differences between log-linear regression and logistic regression? I understand the former is a simple linear regression model but I am not clear on when each should be used.
user38133
  • 457
  • 3
  • 5
  • 8
12
votes
3 answers

Appropriate way to deal with a 3-level contingency table

I have a three level contingency table, with count data for several species, the host plant from which they were collected and whether that collection happened on a rainy day (this actually matters!). Using R, fake data might be something like…
david w
  • 743
  • 1
  • 5
  • 10
12
votes
4 answers

Log Linear Models

Can someone please explain why do we use Log Linear Models in very lay-man terms? I come from Engineering background, and this is really turning out to be a difficult subject for me, statistics that is. I will be grateful for a response.
user1343318
  • 1,231
  • 1
  • 11
  • 17
10
votes
1 answer

Penalized methods for categorical data: combining levels in a factor

Penalized models can be used to estimate models where the number of parameters is equal to or even greater than the sample size. This situation can arise in log-linear models of large sparse tables of categorical or count data. In these settings, it…
andrewH
  • 2,587
  • 14
  • 27
9
votes
1 answer

Fitting a heteroscedastic generalized linear model for binomial responses

I have data from the following experimental design: my observations are counts of the numbers of successes (K) out of corresponding number of trials (N), measured for two groups each comprised of I individuals, from T treatments, where in each such…
9
votes
2 answers

Type of inference to use with log-linear Poisson glm on contingency table frequency counts

I was doing some log-linear models to test for interactions/associations in multiway contingency tables (based on the tutorial here, http://ww2.coastal.edu/kingw/statistics/R-tutorials/loglin.html). I was doing this using a Poisson glm on the…
9
votes
1 answer

Do zero counts need to be adjusted for a likelihood ratio test of poisson/loglinear models?

If there are 0's in the contingency table and we're fitting nested poisson/loglinear models (using R's glm function) for a likelihood ratio test, do we need to adjust the data prior to fitting the glm models (e.g. add 1/2 to all the counts)?…
8
votes
1 answer

Does every log-linear model have a perfectly equivalent logistic regression?

I am trying to fit a log-linear model to a large number of variables from survey data. There are some reasons that it might be preferable to fit logistic regressions to that data instead. Several authorities suggest that these are equivalent. …
andrewH
  • 2,587
  • 14
  • 27
8
votes
2 answers

log-linear vs log-bilinear

I have seen these two terms used often. I can not really tell the difference between them they seem Identical to me. Can someone point me to a resource or give a simple explanation of what the difference is if any? By log-linear I mean a model…
A.D
  • 2,114
  • 3
  • 17
  • 27
7
votes
2 answers

Iterative proportional fitting in R

The mission I am trying to find a way to do Iterative Proportional Fitting in R. The logic of the procedure is like this: one has a table with e.g. sample distribution of some variables. Let us say it is this one: sample1 <- structure(c(6L, 14L,…
Maxim.K
  • 560
  • 7
  • 20
7
votes
0 answers

How do I perform a follow up on a chi-squared table 3x3 or larger?

On a 3x2, like in this example, I could perform an additional follow up chi-squared to test differences between only two groups I'm interested in (e.g. between vaccinated a year before and just before the epidemic groups). But if I had an additional…
7
votes
2 answers

$\chi^2 $ of multidimensional data

I want to test if two observations of nominal data accord to the same distribution. I am using the chi squared statistics to perform a chi squared homogeneity test and normalize the result with Cramer's $\phi$. Unfortunately, all the examples for…
7
votes
2 answers

Are log-linear models exponential models?

What is usually referred to as "log-linear models"? Is a log-linear model an exponential model where the normalization constant is 1 (since its logarithm needs to be a linear function)? Or is there very little difference between the use of the two…
6
votes
2 answers

Using log-linear models for presence/absence data in wildlife

I'm working on a project wherein I compare the presence/absence of a number of bird and herptile species between wetlands that have received three different treatments. The populations were surveyed across two different years. So the response…
user43769
  • 61
  • 1
  • 2
1
2 3
9 10