Internet

references:
- ISI, example 4.2, p.237

data

Internet <- c(24, 26 - 24, 14, 22 - 14)
dim(Internet) <- c(2, 2)
dimnames(Internet) <- list(lied = c("yes", "no"),
                           communication = c("email", "pencil.and.paper"))
Internet
##      communication
## lied  email pencil.and.paper
##   yes    24               14
##   no      2                8

conditional proportions

addmargins(Internet)     # marginal sums
##      communication
## lied  email pencil.and.paper Sum
##   yes    24               14  38
##   no      2                8  10
##   Sum    26               22  48
prop.table(Internet, 2)  # P(lied | communication)
##      communication
## lied       email pencil.and.paper
##   yes 0.92307692        0.6363636
##   no  0.07692308        0.3636364

mosaicplot

mosaicplot(t(Internet), col = c("skyblue", "steelblue"))