I have the loglinear model with parameters x, y, z, v, xy, xv, and z*v. As far as i understand there should exist a logistic regression model that essentially is equivalent to this, using v as response variable. How do i find it, and how does it look like?
I have tried to derive it using the relationship described in http://teaching.sociology.ul.ie/SSS/lugano/node58.html. I end up with the parameters x, z and x*y for the logistic regression model which turns out to be incorrect when testing in R.
I have also tried many other combinations of parameters in R but neither of the parameters in these models has the same values as the parameters in my loglinear model.
The loglinear model and it's results looks like:
Call:
glm(formula = n ~ x * y + x * v + v * z, family = poisson(link = log),
data = data41)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.87421 -0.32788 0.08769 0.38924 1.64946
Coefficients:
Coefficient Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.01862 0.11901 33.767 < 2e-16 ***
x -0.35889 0.16723 -2.146 0.03187 *
y -2.14736 0.04661 -46.068 < 2e-16 ***
v 1.78281 0.12707 14.030 < 2e-16 ***
z -0.83773 0.17843 -4.695 2.67e-06 ***
x:y -0.40431 0.09936 -4.069 4.72e-05 ***
x:v -0.55058 0.16924 -3.253 0.00114 **
v:z 3.32798 0.18425 18.062 < 2e-16 ***
---
Signif. codes: 0 '' 0.001 '' 0.01 '' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 20311.0677 on 15 degrees of freedom
Residual deviance: 7.7197 on 8 degrees of freedom
AIC: 115.69
Number of Fisher Scoring iterations: 4
The logistic regression model(using same data):
Call:
glm(formula = v ~ x + z + x * y, family = binomial(link = logit),
data = data41, weights = n)
Deviance Residuals:
Min 1Q Median 3Q Max
-15.7143 -8.4149 -0.6557 4.6727 9.6823
Coefficients:
Coefficient Estimate Std.Error z value Pr(>|z|)
(Intercept) 1.8298 0.1383 13.232 < 2e-16 ***
x -0.5058 0.1909 -2.650 0.00806 **
z 3.3089 0.1846 17.922 < 2e-16 ***
y -0.5234 0.3058 -1.712 0.08693 .
x:y 0.3586 0.5977 0.600 0.54854
---
Signif. codes: 0 '' 0.001 '' 0.01 '' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1435.5 on 15 degrees of freedom
Residual deviance: 1084.4 on 11 degrees of freedom
AIC: 1094.4
Number of Fisher Scoring iterations: 7
I would expect that for example the parameter x*v in the loglinear model would have equivalent estimate and variance as the x parameter in the logistic regression model, however this is not the case.
I am thankfull for help!