Data for Exercise 8.53

Drink

Format

A data frame/tibble with 472 observations on two variables

drinking

a factor with levels ok, tolerated, and immoral

referendum

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(~drinking + referendum, data = Drink)
T1
#>            referendum
#> drinking    for against undecided
#>   ok         95      83        21
#>   tolerated  73      71        18
#>   immoral    12      46         8
chisq.test(T1)
#> 
#> 	Pearson's Chi-squared test
#> 
#> data:  T1
#> X-squared = 19.702, df = 4, p-value = 0.0005717
#> 
rm(T1)