# R code to analyze a 1 by c contingency table # and make inference about the multinomial probabilities # We look at the blood types data set: # The observed counts are 465, 394, 96, 45. # We test whether the corresponding cell probabilities are # (0.45, 0.4, 0.1, 0.05) using the chisq.test() function in R: chisq.test(c(465, 394, 96, 45), p=c(0.45, 0.4, 0.1, 0.05), correct=FALSE) # Verifying large-sample assumption: obs.counts <- c(465, 394, 96, 45) names(obs.counts) <- c("O", "A", "B", "AB") nullprobs <- c(0.45, 0.4, 0.1, 0.05) names(nullprobs) <- names(obs.counts) exp.counts <- sum(obs.counts) * nullprobs print(exp.counts) # The expected cell counts are all at least 5.