arsenal icon indicating copy to clipboard operation
arsenal copied to clipboard

chi-square p-values of "<0.001" when only one observed factor category

Open fabones1 opened this issue 2 years ago • 0 comments

When you compare groups in columns using a chi-square test and there is only one observed level of a factor outcome, a p-value of "<0.001" is shown. This should be shown as "NA", blank, or something similar. When you specify Fisher's exact test, a blank p-value is correctly reported in this situation.

comptable <- tableby(period ~ rph_doseinc, data=retro, total=FALSE, cat.test="chisq") summary(comptable, text=TRUE)

image

fabones1 avatar May 10 '22 17:05 fabones1