Data for Exercise 8.20

Referend

Format

A data frame with 237 observations on two variables

choice

a factor with levels A, B, and C

response

a factor with levels for, against, and undecided

References

Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Pacific Grove, CA: Brooks/Cole, a division of Thomson Learning.

Examples


T1 <- xtabs(~choice + response, data = Referend)
T1
#>       response
#> choice for against undecided
#>      A  24      29         7
#>      B  68      39        12
#>      C  47       8         3
chisq.test(T1)
#> 
#> 	Pearson's Chi-squared test
#> 
#> data:  T1
#> X-squared = 21.074, df = 4, p-value = 0.0003062
#> 
chisq.test(T1)$expected
#>       response
#> choice      for  against undecided
#>      A 35.18987 19.24051  5.569620
#>      B 69.79325 38.16034 11.046414
#>      C 34.01688 18.59916  5.383966