为了了解数据而进行的任何统计检验-价格越高,质量越好?

问题描述 投票:-3回答:1

我有以下数据集。价格(3:最高);质量评级(4:最佳,0:可悲); obs(在给定价格水平下给予给定评级的人数)

问题:

我想检查一下我的假设,即价格与评级成正比。哪个测试可以给我这个结果?

我可以使用Python在此基础上创建哪些好的可视化效果?

可以从以下链接获取数据,因为以下数据可能没有正确的格式

http://users.stat.ufl.edu/~winner/data/pricequal.dat

price   rating  obs

0 3 0 41 2 0 12 1 0 43 3 1 84 2 1 215 1 1 206 3 2 267 2 2 228 1 2 239 3 3 1510 2 3 1211 1 3 912 3 4 713 2 4 414 1 4 4

python matplotlib statistics
1个回答
0
投票

所以您想评估price是否与rating相关。有许多统计方法可用来评估相关性,在这方面,最好搜索Cross Validated

由于您似乎拥有“分类”数据(即,评分不在连续的类别中,所以我建议使用Spearman's rank correlation。所得的r值描述了两个变量之间的相关程度。

在python中,您可以使用:

from scipy.stats import spearmanr

p, r = spearmanr(x, y)  # x and y are your data

要了解“基于价格,评级会提高多少”,您需要研究线性回归等预测模型。

© www.soinside.com 2019 - 2024. All rights reserved.