Data for Statistical Insight Chapter 8

Inmate

Format

A data frame/tibble with 28,047 observations on two variables

race

a factor with levels white, black, and hispanic

drug

a factor with levels heroin, crack, cocaine, and marijuana

Source

C. Wolf Harlow (1994), Comparing Federal and State Prison Inmates, NCJ-145864, U.S. Department of Justice, Bureau of Justice Statistics.

References

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

Examples


T1 <- xtabs(~race + drug, data = Inmate)
T1
#>           drug
#> race       heroin crack cocaine marijuana
#>   white       407   106    4525      2825
#>   black      1156  2513    4439       442
#>   hispanic   1314   348    7297      2675
chisq.test(T1)
#> 
#> 	Pearson's Chi-squared test
#> 
#> data:  T1
#> X-squared = 6385.2, df = 6, p-value < 2.2e-16
#> 
rm(T1)