バラツキ(分散)の差を検定するF検定を実施する「var.test」コマンドを紹介します。
コマンド
各コマンドの詳細オプションはヘルプを確認してください。
###データ例の準備#####
#Data1の作成
Data1 <- rep(c(4, 7, 8, 3, 11, 15), 100)
#Data2の作成
Data2 <- rep(c(2, 6, 9, 3, 11, 30), 100)
########
###F検定の実施#####
var.test(Data1, Data2, alternative = "two.sided")
F test to compare two variances
data: Data1 and Data2
F = 0.1884, num df = 599, denom df = 599, p-value < 2.2e-16
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.1604786 0.2211395
sample estimates:
ratio of variances
0.188383
########
少しでも、あなたの解析が楽になりますように!!