Multinomial logistic regression corresponds to the setting where each data point has a vector of counts whose total we condition on. The logistic/softmax link + multinomial likelihood is appropriate here.

However, I have a setting where every data point corresponds to a table of counts $y_{ij}$. Is there a likelihood which conditions on the row sums $y_{.j}$ and column sums $y_{i.}$? (i.e. the assumption made by Fisher's exact test for example).

I know one way to approach this would be to consider every individual count as a data point and include a fixed effect for every row & column, but this isn't appealing since I have >1e5 data points.

  • 2
    $\begingroup$ Are you looking for the hypergeometric distribution? (Which is what Fisher's exact test is based on.) $\endgroup$ Feb 23, 2017 at 5:13
  • $\begingroup$ @GordonSmyth Thanks yes, I think in the 2x2 case that's what I want. However a) I want to connect this to covariates so need to somehow link the hypergeometric param (K in the wikipedia notation, n and N being fixed) to my covariates, but $K \in \{0,...,N\}$. b) I want to be able to handle the NxM case. Looks like the multivariate hypergeometric might let me handle the 2xM which would actually be nice in itself. $\endgroup$
    – daknowles
    Feb 23, 2017 at 23:19
  • $\begingroup$ Ok so thinking about this a bit more I want one of the noncentral hypergeometric distributions (probably Wallenius' since the total count is fixed). The noncentrality parameter is what I would link to covariates. Unfortunately these distributions look like a massive pain to work with numerically. $\endgroup$
    – daknowles
    Feb 23, 2017 at 23:45


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.