Honda, Other, Chevy, Toyota, Honda, Toyota, Other, Honda, Ford, Chevy, Honda, Honda, Ford, Toyota, Honda, Honda, Honda, Honda, Toyota, Other, Ford, Ford, Chevy, Chevy, Chevy, Honda, Other, Other, Ford, Chevy
a) Create a relative frequency table containing the categories, frequencies, and relative frequencies. You can do this by hand but the table should be typed.
b) Create a clearly labeled bar chart made using R. Include the commands used to create the bar chart.
c) Interpret the bar chart.
(a)
Category | Frequency | Relative frequency (=Frequency/30) |
Chevy | 6 | 6/30=0.2000 |
Ford | 5 | 5/30=0.1667 |
Honda | 10 | 10/30=0.3333 |
Other | 5 | 5/30=0.1667 |
Toyota | 4 | 4/30=0.1333 |
(b)
R code:
Category=c("Honda", "Other", "Chevy", "Toyota", "Honda",
"Toyota", "Other", "Honda",
"Ford", "Chevy", "Honda", "Honda", "Ford", "Toyota", "Honda",
"Honda", "Honda",
"Honda", "Toyota", "Other", "Ford", "Ford", "Chevy", "Chevy",
"Chevy", "Honda",
"Other", "Other", "Ford", "Chevy")
counts=table(Category)
barplot(counts, main="Bar chart ",
xlab="categories", ylab="Frequency", col=1:5,
legend = rownames(counts), beside=TRUE)
c. We observed that Honda has maximum frequency so Mode=Honda and other 4 categories are more or less same.
Get Answers For Free
Most questions answered within 1 hours.