拟把疏狂醉 发表于 2015-10-18 17:19 
为什么第二个矩阵不是对称的呢?
不对称是因为P值经过了校验(p.adjust),corr.test()函数默认对P值进行校验,校验后的P值更为可靠。如果想获得原始P值,代码需要增加参数。代码如下:
Call:corr.test(x = states, use = "complete", method = "pearson", adjust = "none")
Correlation matrix
Population Income Illiteracy Life Exp Murder HS Grad
Population 1.00 0.21 0.11 -0.07 0.34 -0.10
Income 0.21 1.00 -0.44 0.34 -0.23 0.62
Illiteracy 0.11 -0.44 1.00 -0.59 0.70 -0.66
Life Exp -0.07 0.34 -0.59 1.00 -0.78 0.58
Murder 0.34 -0.23 0.70 -0.78 1.00 -0.49
HS Grad -0.10 0.62 -0.66 0.58 -0.49 1.00
Sample Size
[1] 50
Probability values (Entries above the diagonal are adjusted for multiple tests.)
Population Income Illiteracy Life Exp Murder HS Grad
Population 0.00 0.15 0.46 0.64 0.01 0.5
Income 0.15 0.00 0.00 0.02 0.11 0.0
Illiteracy 0.46 0.00 0.00 0.00 0.00 0.0
Life Exp 0.64 0.02 0.00 0.00 0.00 0.0
Murder 0.01 0.11 0.00 0.00 0.00 0.0
HS Grad 0.50 0.00 0.00 0.00 0.00 0.0