例題:
2変数 x, y について,10 組の測定値がある。x,y の間に相関はあるか。
| x | 9.7 | 10.3 | 9.6 | 7.7 | 10.2 | 10.6 | 10.4 | 11.4 | 7.8 | 8.6 |
|---|---|---|---|---|---|---|---|---|---|---|
| y | 9.9 | 10.9 | 9.4 | 11.4 | 10.1 | 8.4 | 10.4 | 11.4 | 9.0 | 9.6 |
R による解析:
> x <- c(9.7, 10.3, 9.6, 7.7, 10.2, 10.6, 10.4, 11.4, 7.8, 8.6)
> y <- c(9.9, 10.9, 9.4, 11.4, 10.1, 8.4, 10.4, 11.4, 9.0, 9.6)
> cor.test(x, y, method="kendall")
Kendall's rank correlation tau
data: x and y
z.tau = 0.9045, p-value = 0.3657
alternative hypothesis: true tau is not equal to 0
sample estimates:
tau
0.2247333