Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Tonsils

Size of tonsils collected from 1,398 children


Description

Data for Exercise 2.78

Usage

Tonsils

Format

A data frame/tibble with 1,398 observations on two variables

size

a factor with levels Normal, Large, and Very Large

status

a factor with levels Carrier and Non-carrier

References

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

Examples

T1 <- xtabs(~size + status, data = Tonsils)
T1
prop.table(T1, 1)
prop.table(T1, 1)[2, 1]
barplot(t(T1), legend = TRUE, beside = TRUE, col = c("red", "green"))
## Not run: 
library(dplyr)
library(ggplot2)
NDF <- dplyr::count(Tonsils, size, status) 
ggplot2::ggplot(data = NDF, aes(x = size, y = n, fill = status)) + 
           geom_bar(stat = "identity", position = "dodge") + 
           scale_fill_manual(values = c("red", "green")) + 
           theme_bw()

## End(Not run)

BSDA

Basic Statistics and Data Analysis

v1.2.0
GPL (>= 2)
Authors
Alan T. Arnholt [aut, cre], Ben Evans [aut]
Initial release
2017-07-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.