top of page

data.ex=read.csv("Table812.csv",header=T)
data.ex

#関数 aov(従属変数~独立変数,データ)

aov.ex=aov(score~cond,data.ex)

#結果の要約
summary(aov.ex)

#多重比較 テューキー法

TukeyHSD(aov.ex,"cond" , ordered = TRUE)

# Bonferroniの方法による多重比較の場合
attach(data.ex)
pairwise.t.test(score, cond, p.adj = "bonf")

# Holmの方法による多重比較の場合
pairwise.t.test(score, cond, p.adj = "holm")

#結果の図示 まず平均値などを計算
attach(data.ex)
tapply(score,cond,mean)
tapply(score,cond,sd)

#上の結果を使う
x <- c(27.6,32.0,37.8)
names(x) <- c("A","B","C")
barplot(x, xlab = "Treatment", ylab = "MAS score")

#以下は参考、応用

#参考)エラーバーをつけるならば
se <- c(3.049590/sqrt(5), 2.915476/sqrt(5), 3.114482/sqrt(5)) 
b <- barplot(x, xlab = "Treatment", ylab = "MAS score",ylim = c(0, max(x + se)))
arrows(b, x - se, b, x + se, code = 3, lwd = 1, angle = 90, length = 0.1)

#参考)効果量を求める(1)分散分析表のSS を使う p.235参照

eta2 <- 261.7/(261.7+110.0)

eta2

# 参考)効果量とその信頼区間を求める(2) パッケージ(rpsychi)を利用する場合

# R のバージョンが合わないこともあります
install.packages("rpsychi")
library(rpsychi)

ind.oneway(score~cond, data=data.ex)

 

#参考:以下のサイトで偏イータ二乗とその信頼区間を求めることができます

# https://effect-size-calculator.herokuapp.com/

 

# 以下のサイト「ANOVA君」 を使う方法もあります

# http://riseki.php.xdomain.jp/index.php?ANOVA%E5%90%9B
 

bottom of page