This is the appropriate command for the full contingency table. It fits a log-linear model to the nine cell counts, with logarithmic link function and no interaction:
With baseline constraints on , there are five parameters. The factorized means express independence of treatment group and damage category. The maximum-likelihood estimates are
Although the experiment fixes each row total at 30, conditioning these independent Poisson random variables on those totals produces the appropriate row-wise multinomial distribution. The Poisson trick therefore gives the correct likelihood inference for this independence log-linear model for a two-way contingency table; the margins are nuisance parameters. It tests whether treatment changes the distribution of damage, rather than modelling a binary outcome.
This is not a valid ordinary R glm family specification. A multinomial distribution is natural for the three damage counts conditional on the row total, but base R's generalized linear model interface does not supply a family named multinomial. Furthermore, the written response is one cell count, not a three-category response or grouped multinomial vector. A properly specified multinomial logistic regression could model category probabilities by group, but it is not the model fit by this command. The independent-count log-linear model in part (a), conditional on the margins, is the appropriate supplied alternative.
This does not model the full three-category response. A binomial distribution has two outcome classes, whereas the observed damage factor has three. In base R, a factor response to a binomial generalized linear model is coded as first level versus all other levels; this would silently collapse the categories. It would also treat the nine table rows as nine individual observations, ignoring the frequencies. A deliberate binary analysis would require specifying the collapse and retaining the counts, but cannot recover the full damage distribution.
The count weights correct the loss of frequencies for a deliberately coarsened binary response, but do not supply a third outcome category. Thus this remains inappropriate for the full contingency table. With the base R factor convention, it could fit the chosen first damage level versus the other two combined, using a logistic regression and the frequencies as weights. That is a different scientific question. The supplied log-linear model retains all three categories and their counts without this information loss.

Articles by others on the same topic (0)

There are currently no matching articles.