You are on page 1of 2

glm4

z1<-c(17.5,22.5,27.5,32.5,37.5,42.5,47.5)
z2<-c(3,80,216,268,197,150,91)
z3<-c(61,137,131,76,50,24,10)
z4<-c(232,400,301,203,188,164,183)

> ex4a<-glm(cbind(z2,z3)~z1, family=binomial)


> ex4a
Call:

glm(formula = cbind(z2, z3) ~ z1, family = binomial)

Coefficients:
(Intercept)
-3.3496

z1
0.1315

Degrees of Freedom: 6 Total (i.e. Null); 5 Residual


Null Deviance:
302.3
Residual Deviance: 41.61
AIC: 80.94
> summary(ex4a)
Call:
glm(formula = cbind(z2, z3) ~ z1, family = binomial)
Deviance Residuals:
1
2
3
-4.533 -1.056
2.119

4
2.657

5
-1.308

6
-1.765

7
-1.891

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -3.349607
0.282553 -11.86
<2e-16 ***
z1
0.131529
0.009252
14.22
<2e-16 ***
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 302.264
Residual deviance: 41.615
AIC: 80.938

on 6
on 5

degrees of freedom
degrees of freedom

Number of Fisher Scoring iterations: 4


> <-glm(cbind(z2,z3)~z1, family=binomial)
Error: unexpected assignment in "<-"
> ex4b<-glm(cbind(z3,z4)~z1,family=binomial)
> summary(ex4b)
Call:
glm(formula = cbind(z3, z4) ~ z1, family = binomial)
Deviance Residuals:
1
2
3
-3.405 -0.483
3.255

4
2.572

5
1.058

6
-1.273

7
-4.004

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.316307
0.176259 -1.795
0.0727 .
z1
-0.031446
0.005953 -5.283 1.27e-07 ***
--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1
Page 1

glm4
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 77.089
Residual deviance: 47.803
AIC: 90.7

on 6
on 5

degrees of freedom
degrees of freedom

Number of Fisher Scoring iterations: 4

Page 2

You might also like