Your Chi square test is not correct. You need to provide the counts as a table or matrix, not as two separate vectors. Because you have very small expected values for half of the cells, you need to use simulation to estimate the p-value:
results <- chisq.test(diagnosis[, 2:3], simulate.p.value=TRUE)
The overall table is barely significant at .05. The chisq.test
function returns a list including the original data, the expected values, residuals, and standardized residuals. The manual page describes these (?chisq.test
) and provides some citations for more details.
CLICK HERE to find out more related problems solutions.