← 授業トップへ戻る


本日の流れ

  1. 復習(前半):第8〜11回の推測統計のポイントを確認
  2. 習熟度確認テスト(後半):RStudio を使って課題に取り組む

復習:推測統計のまとめ

分析方法の選び方

比較・分析したいもの 使う検定
2変数の直線的関係(両方連続) 相関分析(cor.test())
2つのカテゴリ変数の関連 カイ二乗検定(chisq.test())
独立した2群の平均値の差 独立2標本t検定(t.test())
同一人の2時点の差 対応のあるt検定(t.test(..., paired=TRUE))
3群以上の平均値の差 分散分析(第13〜14回)

相関分析(第8回)の復習

cor.test(iris$Sepal.Length, iris$Petal.Length)
## 
##  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


カイ二乗検定(第9回)の復習

tab <- table(mtcars$cyl, mtcars$am)
chisq.test(tab)
## 
##  Pearson's Chi-squared test
## 
## data:  tab
## X-squared = 8.7407, df = 2, p-value = 0.01265

報告例:χ²(2, N = 32) = ○○, p = ○○


独立t検定(第10回)の復習

t.test(mpg ~ am, data = mtcars)
## 
##  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


対応ありt検定(第11回)の復習

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

習熟度確認テスト(第2回)

問題は授業当日に配布します。

この回は前半が復習,後半が習熟度確認テストです。 テストは RStudio で実際にデータを分析し,作成した .R スクリプトを提出する形式で行います。 出題範囲は,上の復習部分で扱った内容です。

問題と解答例は,テスト実施後にこのページへ掲載します。


参考:分析の報告フォーマット

相関分析

X と Y の間には〇〇な相関が認められた,r(df) = .〇〇,p < .〇〇。

t検定

A 群(M = 〇〇,SD = 〇〇)と B 群(M = 〇〇,SD = 〇〇)の間に有意な差が認められた,t(df) = 〇〇,p = .〇〇,d = 〇〇。

カイ二乗検定

X と Y の間に有意な関連が認められた,χ²(df, N = 〇〇) = 〇〇,p < .〇〇。


本日のまとめ

  • 相関・カイ二乗・t検定(独立・対応あり)の選択と実行を確認した
  • 結果の解釈と報告のフォーマットを押さえた

次回の予告

次回(第13回)から分散分析に入ります。

  • なぜ3群以上のときにt検定を繰り返してはいけないのか?
  • 一元配置分散分析(one-way ANOVA)の論理

教科書の分散分析の章を読んでおいてください。


← 授業トップへ戻る