Re: [R] Fitting loglinear model with glm() and loglm()

2012-03-20 Thread Søren Højsgaard
-project.org [mailto:r-help-boun...@r-project.org] På vegne af Christofer Bogaso Sendt: 20. marts 2012 11:04 Til: r-help@r-project.org Emne: [R] Fitting loglinear model with glm() and loglm() Dear all, I have small difficulty in comprehending the loglinear model with R. Assume, we have following

Re: [R] Fitting loglinear model with glm() and loglm()

2012-03-20 Thread Achim Zeileis
On Tue, 20 Mar 2012, Christofer Bogaso wrote: Dear all, I have small difficulty in comprehending the loglinear model with R. Assume, we have following data dat <- array(c(911, 44, 538, 456, 3, 2, 43, 279), c(2, 2, 2)) Now I fit a loglinear model with this and get the fitted values: library(MA

[R] Fitting loglinear model with glm() and loglm()

2012-03-20 Thread Christofer Bogaso
Dear all, I have small difficulty in comprehending the loglinear model with R. Assume, we have following data dat <- array(c(911, 44, 538, 456, 3, 2, 43, 279), c(2, 2, 2)) Now I fit a loglinear model with this and get the fitted values: library(MASS) Model_1 <- loglm(~1 + 2 + 3, dat) fitted(Mode