Python 推断基础
Paul Savala
Assistant Professor of Mathematics


new_satisfaction = [94, 85, 79, 91, 82] old_satisfcation = [90, 87, 77, 85, 82]# 将数据放在一起 data = (new_satisfaction, old_satisfcation)# 定义检验统计量 def statistic(x, y): return np.mean(x) - np.mean(y)# 计算均值差的置换检验 stats.permutation_test(data, statistic, n_resamples=1000, vectorized=False, alternative='greater')

stats.pearsonr(red_data, blue_data)[0]
0.08
data = (red_data, blue_data)def statistic(x, y): return stats.pearsonr(x, y)[0]res = stats.permutation_test(data, statistic, n_resamples=1000, vectorized=False, alternative='two-sided')print(res.pvalue < 0.05)
False
Python 推断基础