[R]{coin} independence_test() : random permutation testを実行する関数

説明

independence_test() は任意の尺度で測定された2群の変数の独立性を検定する関数である。

使用法

S3 method for class ‘formula’
independence_test(formula, data, subset = NULL, weights = NULL, …)

使用例

# 平均の差のノンパラメトリック検定
> independence_test(warpbreaks$breaks~warpbreaks$wool,distribution=approximate(B=10000))

	Approximative General Independence Test

data:  warpbreaks$breaks by warpbreaks$wool (A, B)
Z = 1.6084, p-value = 0.1127
alternative hypothesis: two.sided

# 平均の差のパラメトリック検定の例(t検定)
> t.test(warpbreaks$breaks~warpbreaks$wool)

	Welch Two Sample t-test

data:  warpbreaks$breaks by warpbreaks$wool
t = 1.6335, df = 42.006, p-value = 0.1098
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -1.360096 12.915652
sample estimates:
mean in group A mean in group B 
       31.03704        25.25926 

関連

ランダムパーミュテーションテストとは何かは以下に解説あり。

http://danielnee.com/2015/01/random-permutation-tests/

コメント