R/BSDA-package.R
Chevy.RdData for Exercise 8.35
ChevyA data frame/tibble with 67 observations on two variables
a factor with levels 1988-90 and
1991-93
a factor with levels much better than average, above average,
average, below average, and much worse than average
Insurance Institute for Highway Safety and the Highway Loss Data Institute, 1995.
Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Pacific Grove, CA: Brooks/Cole, a division of Thomson Learning.
T1 <- xtabs(~year + frequency, data = Chevy)
T1
#> frequency
#> year much better than average above average average below average
#> 1988-90 16 5 5 3
#> 1991-93 12 2 12 2
#> frequency
#> year much worse than average
#> 1988-90 4
#> 1991-93 6
chisq.test(T1)
#> Warning: Chi-squared approximation may be incorrect
#>
#> Pearson's Chi-squared test
#>
#> data: T1
#> X-squared = 5.3258, df = 4, p-value = 0.2555
#>
rm(T1)