M&Ms

references:
- ISI, example 7.3, p.399

library(tidyverse)
library(knitr)

data

MMs <- read.delim("BowlsMMs.txt")
str(MMs)
## 'data.frame':    17 obs. of  2 variables:
##  $ Small: int  33 24 35 24 40 33 88 36 65 38 ...
##  $ Large: int  41 92 61 19 21 35 42 50 11 104 ...
MMs <- MMs %>%
  mutate(diff = Small - Large)
str(MMs)
## 'data.frame':    17 obs. of  3 variables:
##  $ Small: int  33 24 35 24 40 33 88 36 65 38 ...
##  $ Large: int  41 92 61 19 21 35 42 50 11 104 ...
##  $ diff : int  -8 -68 -26 5 19 -2 46 -14 54 -66 ...
tbl <- MMs %>%
  summarize(x.bar.d = mean(diff),
            s.d = sd(diff),
            n.d = n())
kable(tbl)
x.bar.d s.d n.d
-10.88235 36.30062 17

dot plot

ggplot(MMs, aes(diff)) +
  geom_dotplot(binwidth = 2, dotsize = 1.0, fill = "firebrick") +
  labs(title = "M&Ms")