factor(day) treats the nine days as categorical rather than imposing a numerical time trend. rep(400,27) supplies the number of trials for every dish, and prop is the observed surviving proportion. The contrast setting uses treatment coding with day 1 as reference; the ordered-factor polynomial option is unused. Supplying these proportions to glm with the binomial family and weights gives precisely the grouped-binomial logistic regression likelihood for the counts. The weights represent trial counts, not additional independent dish observations. The binomial family's default link is the logit link and its dispersion is fixed at .
Let be survivors in dish on day . Both fitted models assume independent . Model 1 specifies
so it has one common probability and one fitted coefficient. Its estimated probability is the total surviving count divided by the total trial count, .
Model 2 specifies
It has nine coefficients and allows a separate probability for each day, while retaining a common probability for the three dishes within that day. The MLEs are the day totals divided by . In day order they are
The intercept is the first day's logit, and each other coefficient is its day's logit minus that reference. These are additive effects on log odds, not additive changes in survival probability.
The analysis of deviance adds the eight day indicators after an intercept-only model. Its residual deviance compares a fitted model with the saturated statistical model assigning one separate probability to each of the dishes. For fitted dish probabilities , the binomial deviance is
The binomial scale is one, so this is also scaled deviance. The reported decrease measures the extra fit provided by day. There are observational units for these residual statistical degrees of freedom, not separately fitted Bernoulli responses.

Articles by others on the same topic (0)

There are currently no matching articles.