【发布时间】:2020-01-19 14:14:47
【问题描述】:
我收集了包含 1-5 星级餐厅调查评分的汇总数据。
如何绘制分布图并在 R 中找到标准误?
是否可以进行更高级的分析,例如分组评级(例如所有快餐店的错误,即麦当劳+汉堡王、所有牛排馆等)和 t 检验?
数据如下:
Restaurant Question 1.star 2.stars ...etc
McDonalds How was the food? 5 6 ...
McDonalds How were the drinks? 3 4
McDonalds How were the workers? 2 7
Burger_King How was the food? 4 11
Burger_King How were the drinks? 9 3
Burger_King How were the workers? 12 1
为方便起见,这里是一个 tribble:
tribble(
~restaurant, ~question, ~one_star, ~two_star, ~three_star, ~four_star, ~five_star, ~average,
"McDonalds", "How was the food?", 5, 6, 8, 2, 9, (5*1 + 6*2 + 8*3 + 2*4 + 5*9)/(5 + 6 + 8 + 2 + 9),
"McDonalds", "How were the drinks?", 9, 8, 7, 5, 1, (9*1 + 8*2 + 7*3 + 5*4 + 5*1)/(9 + 8 + 7 + 5 + 1),
"McDonalds", "How were the drinks?", 9, 8, 7, 5, 1, (9*1 + 8*2 + 7*3 + 5*4 + 5*1)/(9 + 8 + 7 + 5 + 1),
"BurgerKing", "How was the food?", 5, 6, 8, 2, 9, (5*1 + 6*2 + 8*3 + 2*4 + 5*9)/(5 + 6 + 8 + 2 + 9),
"BurgerKing", "How were the drinks?", 9, 8, 7, 5, 1, (9*1 + 8*2 + 7*3 + 5*4 + 5*1)/(9 + 8 + 7 + 5 + 1),
"BurgerKing", "How were the drinks?", 9, 8, 7, 5, 1, (9*1 + 8*2 + 7*3 + 5*4 + 5*1)/(9 + 8 + 7 + 5 + 1)
)
【问题讨论】:
标签: r