options(scipen=999)
options(digits=9)
cat("\014") # clear screen
rm(list=ls(all=TRUE))

row1=c(182,215,203)
row2=c(154,136,110)
obs=rbind(row1,row2)
M <- as.table(obs)
dimnames(M) <- list(Vaccine = c("West","East"),
                    Effect = c("Protestant","Catholic","Jew"))
Xsq <- chisq.test(M,correct = FALSE)  # Prints test summary
Xsq
Xsq$observed  # observed counts (same as M)
Xsq$expected  # expected counts under the null


row1=c(182,215,203)
row2=c(154,136,110)
obs=rbind(row1,row2)
chisq.test(obs,correct = FALSE)
