In the previous activity, we entered observed counts into R and calculated expected counts. This time we will enter the same observed counts and conduct a chi-square test on the data.
To enter the data, use the command:
data = data.frame(no.risk=c(793,441),moderate.to.severe.risk=c(309,110),row.names=c("participated","did.not.participate")); data
Then enter this command to calculate the p-value for the chi-square test:
chisq.test(data)