1 / 9

R での Scheffe の多重比較

R での Scheffe の多重比較. Scheffe の多重比較を行うには?. 青木繁伸先生作成の関数 scheffe を利用する aov 関数でのデフォルトの対比を変更して分散分析を実行する.ただし,この方法は  Scheffe の方法とは少し異なる. 得られる t 値はほぼ同じ 参考: Crawley, M. J. 『 統計学: R を用いた入門書 』 (共立出版) 第12章.. データ. ボーンシュテット & ノーキ 『 社会統計学 』 表 7.1 のデータを用いる. 監視 の有無が課題遂行に及ぼす影響.1要因3水準のデザイン.

damita
Download Presentation

R での Scheffe の多重比較

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RでのScheffeの多重比較

  2. Scheffeの多重比較を行うには? • 青木繁伸先生作成の関数scheffeを利用する • aov関数でのデフォルトの対比を変更して分散分析を実行する.ただし,この方法は Scheffeの方法とは少し異なる. • 得られる t 値はほぼ同じ • 参考:Crawley, M. J. 『統計学:Rを用いた入門書』(共立出版)第12章.

  3. データ • ボーンシュテット & ノーキ『社会統計学』表7.1のデータを用いる. • 監視の有無が課題遂行に及ぼす影響.1要因3水準のデザイン. • 社会統計学の授業ウェブからデータをCSVでダウンロードできる.

  4. > monitor <- read.csv("table7_1.csv") > head(monitor) score condition 1 13 na 2 14 na 3 10 na 4 11 na 5 12 na 6 10 na > na:監視なしー隔離条件 nt:監視なしー共作業条件 m:監視条件

  5. 各条件の平均値と分散 > tapply(monitor$score, monitor$condition, mean) m nant 8.2 11.8 10.0 > > tapply(monitor$score, monitor$condition, var) m nant 2.622222 1.733333 1.333333 >

  6. デフォルトの contrasts > contrasts(monitor$condition) nant m 0 0 na 1 0 nt 0 1

  7. 対比の指定 > contrasts(monitor$condition) <- cbind(c(1,-1/2,-1/2),c(0,-1,1)) > contrasts(monitor$condition) [,1] [,2] m 1.0 0 na -0.5 -1 nt -0.5 1 >

  8. 分析の実行 > summary.lm(aov(monitor$score ~ monitor$condition)) Call: aov(formula = monitor$score ~ monitor$condition) Residuals: Min 1Q Median 3Q Max -2.200e+00 -9.500e-01 3.188e-17 9.500e-01 2.800e+00 続きは次のスライド

  9. 分析の実行(つづき) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 10.0000 0.2514 39.775 < 2e-16 *** monitor$condition1 -1.8000 0.3556 -5.063 2.57e-05 *** monitor$condition2 -0.9000 0.3079 -2.923 0.00694 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 1.377 on 27 degrees of freedom Multiple R-squared: 0.5586, Adjusted R-squared: 0.5259 F-statistic: 17.09 on 2 and 27 DF, p-value: 1.603e-05

More Related