Data for Exercise 8.21
Snore
A data frame/tibble with 2,484 observations on two variables
factor with levels nonsnorer
, ocassional snorer
,
nearly every night
, and snores every night
factor indicating whether the indiviudal has heart disease
(no
or yes
)
Norton, P. and Dunn, E. (1985), Snoring as a Risk Factor for Disease, British Medical Journal, 291, 630-632.
Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Pacific Grove, CA: Brooks/Cole, a division of Thomson Learning.
T1 <- xtabs(~ heartdisease + snore, data = Snore)
T1
#> snore
#> heartdisease nonsnorer occassional snorer nearly every night snores every night
#> yes 24 35 21 30
#> no 1355 603 192 224
chisq.test(T1)
#>
#> Pearson's Chi-squared test
#>
#> data: T1
#> X-squared = 72.782, df = 3, p-value = 1.082e-15
#>
rm(T1)