> dput(t)
structure(c(125L, 25L, 28L, 8L, 0L, 68L, 13L, 9L, 10L, 0L), .Dim = c(5L,
2L), .Dimnames = list(c("Married", "Widowed", "Divorced", "Never married",
"Other"), c("control", "case")))
> t
control case
Married 125 68
Widowed 25 13
Divorced 28 9
Never married 8 10
Other 0 0
> chisq.test(t)
Pearson's Chi-squared test
data: t
X-squared = NaN, df = 4, p-value = NA
Warning messages:
1: In chisq.test(t, simulate.p.value = TRUE) :
cannot compute simulated p-value with zero marginals
2: In chisq.test(t, simulate.p.value = TRUE) :
Chi-squared approximation may be incorrect
I am trying to see whether marital status affects a person's disease status. However, when I run the Pearson test, I get the above errors. Is this happening because I only have 2 categories for the disease status (i.e: control or case)? What is another appropriate test that I can use instead?