In: Statistics and Probability
Construct a frequency distribution for the motor fuel octane data below using RStudio:
Rating
88.5
94.7
84.3
90.1
89
89.8
91.6
90.3
90
91.5
89.9
98.8
88.3
90.4
91.2
90.6
92.2
87.7
91.1
86.7
93.4
96.1
89.6
90.4
91.6
90.7
88.6
88.3
94.2
85.3
90.1
89.3
91.1
92.2
83.4
91
88.2
88.5
93.3
87.4
91.1
90.5
100.3
87.6
92.7
87.9
93
94.4
90.4
91.2
86.7
94.2
90.8
90.1
91.8
88.4
92.6
93.7
96.5
84.3
93.2
88.6
88.7
92.7
89.3
91
87.5
87.8
88.3
89.2
92.3
88.9
89.8
92.7
93.3
86.7
91
90.9
89.9
91.8
89.7
92.2
You need to use R. Please show all work
The R code is:
Rating <- c(88.5, 94.7,
84.3, 90.1, 89,
89.8, 91.6, 90.3,
90, 91.5, 89.9,
98.8, 88.3, 90.4,
91.2, 90.6, 92.2,
87.7, 91.1, 86.7,
93.4, 96.1, 89.6,
90.4, 91.6, 90.7,
88.6, 88.3, 94.2,
85.3, 90.1, 89.3,
91.1, 92.2, 83.4,
91, 88.2, 88.5,
93.3, 87.4, 91.1,
90.5, 100.3, 87.6,
92.7, 87.9, 93,
94.4, 90.4, 91.2,
86.7, 94.2, 90.8,
90.1, 91.8, 88.4,
92.6, 93.7, 96.5,
84.3, 93.2, 88.6,
88.7, 92.7, 89.3,
91, 87.5, 87.8,
88.3, 89.2, 92.3,
88.9, 89.8, 92.7,
93.3, 86.7, 91,
90.9, 89.9, 91.8,
89.7, 92.2)
table(Rating)
bins <- seq(83.4, 100.3,by = 2)
Rating <- cut(Rating, bins)
transform(table(Rating))
The R output is:
The answer is:
Rating Freq
1 (83.4,85.4] 3
2 (85.4,87.4] 4
3 (87.4,89.4] 20
4 (89.4,91.4] 27
5 (91.4,93.4] 18
6 (93.4,95.4] 5
7 (95.4,97.4] 2
8 (97.4,99.4] 1