Let be the number of ice creams in price category and score category . The fitted Poisson regression assumes that the nine counts are independent random variables with
where the logarithmic link function is used and excellent is the reference level in a regression factor, so . Equivalently,
This is the independence log-linear model for a two-way contingency table: price and score have main effects but no interaction.
Write and . Under the model in part (a),
and is independent of the price category . The Poisson-multinomial conditioning identity gives
More explicitly, the likelihood function for row factors as
The first factor is the likelihood of the row total and the second is the conditional multinomial likelihood. The free price effect makes the first factor maximal at , while maximizing the remaining factors gives
Consequently both fits have the same maximum-likelihood fitted value
Here every row total is , the column totals are , and , so every fitted row is
This factorization is the Poisson trick.
The null hypothesis is that price and score are independent, equivalently that the independence log-linear model for a two-way contingency table is correct. Against the saturated alternative, the reported Poisson deviance is the likelihood-ratio test statistic
Under the null and the usual large-sample regularity assumptions, Wilks theorem gives
The observations must be independent, the cell probabilities must not lie on the boundary of the parameter space, and the expected counts must be large enough for the chi-squared asymptotic approximation. The fitted counts are either or , so the customary expected-count check is comfortably satisfied. Since
(equivalently, the p-value is about ), we do not reject the null at the significance level. The data provide no significant lack of fit for independence.
Both variables are ordinal categorical variables, and the proposed alternative is directional: higher scores should tend to occur at higher prices. Assign increasing numerical scores to low, medium, high price and to poor, good, excellent quality, and use a one-sided linear-by-linear association test. Its statistic is based on the sample covariance, or equivalently the correlation, of those scores under the fixed margins.
This test uses one degree of freedom and directs its rejection region toward positive association. The four-degree-of-freedom likelihood-ratio test of independence in a contingency table spends power on every possible departure from independence, including unordered and negative patterns, so the ordered one-sided test is more powerful when the stated alternative is credible.

Articles by others on the same topic (0)

There are currently no matching articles.