| 比較・分析したいもの | 使う検定 |
|---|---|
| 2変数の直線的関係(両方連続) | 相関分析(cor.test()) |
| 2つのカテゴリ変数の関連 | カイ二乗検定(chisq.test()) |
| 独立した2群の平均値の差 | 独立2標本t検定(t.test()) |
| 同一人の2時点の差 | 対応のあるt検定(t.test(..., paired=TRUE)) |
| 3群以上の平均値の差 | 分散分析(第13〜14回) |
##
## Pearson's product-moment correlation
##
## data: iris$Sepal.Length and iris$Petal.Length
## t = 21.646, df = 148, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.8270363 0.9055080
## sample estimates:
## cor
## 0.8717538
報告例:r(148) = .87, p < .001
##
## Pearson's Chi-squared test
##
## data: tab
## X-squared = 8.7407, df = 2, p-value = 0.01265
報告例:χ²(2, N = 32) = ○○, p = ○○
##
## Welch Two Sample t-test
##
## data: mpg by am
## t = -3.7671, df = 18.332, p-value = 0.001374
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -11.280194 -3.209684
## sample estimates:
## mean in group 0 mean in group 1
## 17.14737 24.39231
報告例:t(18.33) = -3.77, p = .001
set.seed(42)
n <- 15
before <- round(rnorm(n, 6.0, 0.8), 1)
after <- round(before + rnorm(n, 0.8, 0.5), 1)
t.test(after, before, paired = TRUE)##
## Paired t-test
##
## data: after and before
## t = 3.6211, df = 14, p-value = 0.00278
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## 0.2554933 0.9978400
## sample estimates:
## mean difference
## 0.6266667
問題は授業当日に配布します。
この回は前半が復習,後半が習熟度確認テストです。 テストは RStudio
で実際にデータを分析し,作成した .R
スクリプトを提出する形式で行います。
出題範囲は,上の復習部分で扱った内容です。
問題と解答例は,テスト実施後にこのページへ掲載します。
X と Y の間には〇〇な相関が認められた,r(df) = .〇〇,p < .〇〇。
A 群(M = 〇〇,SD = 〇〇)と B 群(M = 〇〇,SD = 〇〇)の間に有意な差が認められた,t(df) = 〇〇,p = .〇〇,d = 〇〇。
X と Y の間に有意な関連が認められた,χ²(df, N = 〇〇) = 〇〇,p < .〇〇。
次回(第13回)から分散分析に入ります。
教科書の分散分析の章を読んでおいてください。