Dealers | R Documentation |
Data for Example 2.22
Dealers
A data frame/tibble with 122 observations on two variables
a factor with levels Honda
, Toyota
, Mazda
,
Ford
, Dodge
, and Saturn
a factor with levels Replaces unnecessarily
and Follows manufacturer guidelines
Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Pacific Grove, CA: Brooks/Cole, a division of Thomson Learning.
xtabs(~type + service, data = Dealers)
T1 <- xtabs(~type + service, data = Dealers)
T1
addmargins(T1)
pt <- prop.table(T1, margin = 1)
pt
barplot(t(pt), col = c("red", "skyblue"), legend = colnames(T1))
rm(T1, pt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.