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$.

171 questions
6
votes
1 answer

What distribution to fit if the log of log is still convex?

I am trying to fit a model with variable x, and y. plot(x, y) shows that it is convex (downward) and decaying which makes me think I need to make a log transformation of y, but plot(x, log(y)) is still convex, even more plot(x, log(log(y))), plot(x,…
Psidom
  • 163
1
vote
1 answer

Compressing vectors by using log-linear modeling?

I have $k$ vectors, each consisting of $2^n$ positive reals adding up to 1, and I'd like to compress them by only saving $n$ reals per vector. One approach is a no-interactions log-linear model to model $2^n$ outcomes by using $n$ parameters for $k$…
Yaroslav Bulatov
  • 6,199
  • 2
  • 28
  • 42
1
vote
1 answer

I want to find contributions of each independent variables

I would like to get contributions of independent variables (factors driving sales) in absolute dollar values. The log linear equation looks like this: $$\ln(\text{sales})=b_1 \times \ln(\text{baseline})+b_2 \times \text{weather} +b_3 \times…
Tstat
  • 11
0
votes
0 answers

Mean of predicted values in a log-linear model

I run a log linear model $$\log(Y)=\alpha + \beta X + \epsilon$$ and wonder how to calculate the mean of predicted values, in the same dimension as the initial (untransformed) variable Y. I would like to find the same value than the variable $Y$,…
thogs
  • 41
  • 5
0
votes
0 answers

How is a covariate added to a log-linear model?

There are a number of good Q/As about log-linear models (i.e., here). The data I am analyzing is off shifts between categories, 0, 1, 2, 3, 4, and 5, within students, in that Var1 represents a student's category at Time 1, and Var2 represents a…