我是统计学的新手,需要对我的论文工作做一些简单的相关性测试,
我按照this guilde来计算2个样本结果n1和n2之间的人物相关性 .
输入数据:
n1:2 2 3 5 3 4 4 4 4 4 2 4 4 2 2 4 2 2 2 5 3 2 2 5 5 2 5 5 2 2 2 2 2 2 2 2 4 5 2 5 2 n2:2 2 3 5 3 4 4 2 2 2 2 4 4 4 2 3 5 2 2 2 4 4 4 3 2 2 2 2 1 1 2 2 2 2 2 2 2 3 2 3 3
我在R中调用的函数:
p = cor.test(n1,n2,method="pearson", conf.level=0.9)
问题是:无论我设置的置信区间是什么值 conf.level
,它都计算到相同的值;所以参数 conf.level
不会影响相关性 .
为什么?我怎样才能使置信水平影响Pearson相关值?
1 回答
你不能!
实际上,根据相关系数的定义,置信水平仅影响置信区间 . 在R工具箱的情况下,根据Correlation, "confidence level for the returned confidence interval. Currently only used for the Pearson product moment correlation coefficient if there are at least 4 complete pairs of observations “
另见:Confidence interval