Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count <- c(18, 28, 14, 20, 51, 28, 12, 25, 9)
- w <- rep(c("T", "M", "S"), 3)
- h <- c(rep("T", 3), rep("M", 3), rep("S", 3))
- wife <- factor(w)
- husband <- factor(h)
- height <- data.frame(count, husband, wife)
- > height
- count husband wife
- 1 18 T T
- 2 28 T M
- 3 14 T S
- 4 20 M T
- 5 51 M M
- 6 28 M S
- 7 12 S T
- 8 25 S M
- 9 9 S S
- height.glm <- glm(count ~ husband + wife, family = poisson)
- summary(height.glm)
- all:
- glm(formula = count ~ husband + wife, family = poisson)
- Deviance Residuals:
- 1 2 3 4 5 6 7 8 9
- 0.849 -0.448 -0.242 -0.870 0.109 0.664 0.230 0.340 -0.751
- Coefficients:
- Estimate Std. Error z value Pr(>|z|)
- (Intercept) 3.917 0.122 32.15 < 2e-16 ***
- husbandS -0.766 0.178 -4.30 1.7e-05 ***
- husbandT -0.501 0.164 -3.06 0.0022 **
- wifeS -0.713 0.171 -4.17 3.1e-05 ***
- wifeT -0.732 0.172 -4.26 2.1e-05 ***
- ---
- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- (Dispersion parameter for poisson family taken to be 1)
- Null deviance: 50.5890 on 8 degrees of freedom
- Residual deviance: 2.9232 on 4 degrees of freedom
- AIC: 56.57
- Number of Fisher Scoring iterations: 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement