> seed.df <- read.table("seed.dat",header=T) > seed.df seed root y n 1 O75 Bean 10 39 2 O75 Bean 23 62 3 O75 Bean 23 81 4 O75 Bean 26 51 5 O75 Bean 17 39 6 O75 Cmbr 5 6 7 O75 Cmbr 53 74 8 O75 Cmbr 55 72 9 O75 Cmbr 32 51 10 O75 Cmbr 46 79 11 O75 Cmbr 10 13 12 O73 Bean 8 16 13 O73 Bean 10 30 14 O73 Bean 8 28 15 O73 Bean 23 45 16 O73 Bean 0 4 17 O73 Cmbr 3 12 18 O73 Cmbr 22 41 19 O73 Cmbr 15 30 20 O73 Cmbr 32 51 21 O73 Cmbr 3 7 > attach(seed.df) > #Binomial model with logit link > seed.fit1 <- glm(cbind(y,n-y)~seed*root,binomial) > summary(seed.fit1) Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -0.4122 0.1842 -2.238 0.0252 * seedO75 -0.1459 0.2232 -0.654 0.5132 rootCmbr 0.5401 0.2498 2.162 0.0306 * seedO75:rootCmbr 0.7781 0.3064 2.539 0.0111 * --- (Dispersion parameter for binomial family taken to be 1) Null deviance: 98.719 on 20 degrees of freedom Residual deviance: 33.278 on 17 degrees of freedom > > #Another way to fit the same model > seed.fit2 <- glm(y/n~seed*root,binomial,weights=n) > summary(seed.fit2) Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -0.4122 0.1842 -2.238 0.0252 * seedO75 -0.1459 0.2232 -0.654 0.5132 rootCmbr 0.5401 0.2498 2.162 0.0306 * seedO75:rootCmbr 0.7781 0.3064 2.539 0.0111 * --- (Dispersion parameter for binomial family taken to be 1) Null deviance: 98.719 on 20 degrees of freedom Residual deviance: 33.278 on 17 degrees of freedom > > #"Quasi-likelihood" fit - logit link > seed.fit3 <- glm(y/n~seed*root,quasi(link="logit",variance="mu(1-mu)"), + weights=n) > summary(seed.fit3) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -0.4122 0.2513 -1.640 0.1193 seedO75 -0.1459 0.3045 -0.479 0.6379 rootCmbr 0.5401 0.3409 1.584 0.1315 seedO75:rootCmbr 0.7781 0.4181 1.861 0.0801 . --- (Dispersion parameter for quasi family taken to be 1.861797) Null deviance: 98.719 on 20 degrees of freedom Residual deviance: 33.278 on 17 degrees of freedom > > #"Quasi-likelihood" fit - identity link > combo <- as.factor(c(rep("b75",5),rep("c75",6),rep("b73",5),rep("c73",5))) > seed.fit4 <- glm(y/n~combo-1,quasi(link="identity", + variance="mu(1-mu)"),weights=n) > summary(seed.fit4) Coefficients: Estimate Std. Error t value Pr(>|t|) combob73 0.39837 0.06023 6.614 4.39e-06 *** combob75 0.36397 0.03981 9.143 5.66e-08 *** comboc73 0.53191 0.05734 9.277 4.60e-08 *** comboc75 0.68136 0.03702 18.407 1.16e-12 *** --- (Dispersion parameter for quasi family taken to be 1.861832) Null deviance: Inf on 21 degrees of freedom Residual deviance: 33.278 on 17 degrees of freedom