Cross Validated
2026-02-12 09:51 UTC
By Roger V.
AI-113-20260212-social-media-1c1b19ff
Adjusting for small sample/zeros in logistic regression
For a contingency table like $$ \begin{matrix}0&5\\139&20\end{matrix} $$ (rows are Exposure, columns are Disease) Fisher exact test gives p-value $5.7\cdot10^{-5}$ , which in many cases would be judged as significant. However, calculating odds ratio would require regularization, due to the presence of a zero value. E.g., Jewell suggests using $$ OR=\frac{ad}{bc}\longrightarrow OR=\frac{\left(a+\frac{1}{2}\right)\left(d+\frac{1}{2}\right)}{\left(b+\frac{1}{2}\right)\left(c+\frac{1}{2}\right)} $$ I would like to be able to carry out this analysis using logistic regression, as I am planning to include continuous confounding variables. However logistic regression returns a p-value that is close to 1. It is clear that logistic p-value implies continuous approximation, which might work poorly for zero counts... I am wondering how to reconcile the two approaches. Remark : There is some ambiguity about the p-value returned by logistic regressionn, since the presence of zero requires some degree of regularization, which in logistic regression software is usually L1 or L2. If any software knows how to handle such cases consistently with Fisher test, I am interested in how they do it. Related: Mixed-effect logistic regression with small sample size: is it possible or do you have alternative solutions? Calculating odds ratio when there is a confounder: contingency table vs logistic regression
For a contingency table like $$ \begin{matrix}0&5\\139&20\end{matrix} $$ (rows are Exposure, columns are Disease) Fisher exact test gives p-value $5.7\cdot10^{-5}$ , which in many cases would be judged as significant. However, calculating odds ratio would require regularization, due to the presence of a zero value. E.g., Jewell suggests using $$ OR=\frac{ad}{bc}\longrightarrow OR=\frac{\left(a+\frac{1}{2}\right)\left(d+\frac{1}{2}\right)}{\left(b+\frac{1}{2}\right)\left(c+\frac{1}{2}\right)} $$ I would like to be able to carry out this analysis using logistic regression, as I am planning to include continuous confounding variables. However logistic regression returns a p-value that is close to 1. It is clear that logistic p-value implies continuous approximation, which might work poorly for zero counts... I am wondering how to reconcile the two approaches. Remark : There is some ambiguity about the p-value returned by logistic regressionn, since the presence of zero requires some degree of regularization, which in logistic regression software is usually L1 or L2. If any software knows how to handle such cases consistently with Fisher test, I am interested in how they do it. Related: Mixed-effect logistic regression with small sample size: is it possible or do you have alternative solutions? Calculating odds ratio when there is a confounder: contingency table vs logistic regression
Full article content could not be extracted automatically. Read the original below.
Source:
Cross Validated
· stats.stackexchange.com