※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。


データ

  • Table 3.6.1 (p.64)

Sequence SID Period1 Period2
RT 1 74.675 73.675
RT 4 96.4 93.25
RT 5 101.95 102.125
RT 6 79.05 69.45
RT 11 79.05 69.025
RT 12 85.95 68.7
RT 15 69.725 59.425
RT 16 86.275 76.125
RT 19 112.675 114.875
RT 20 99.525 116.25
RT 23 89.425 64.175
RT 24 55.175 74.575
TR 2 74.825 37.35
TR 3 86.875 51.925
TR 7 81.675 72.175
TR 8 92.7 77.5
TR 9 50.45 71.875
TR 10 66.125 94.025
TR 13 122.45 124.975
TR 14 99.075 85.225
TR 17 86.35 95.925
TR 18 49.925 67.1
TR 21 42.7 59.425
TR 22 91.725 114.05

プログラムと結果

変量効果モデル


library(nlme)
tab361 <- read.table("table361.csv", sep=",", header=T)

nrow1 <- nrow(tab361)
sequence <- rep(tab361$Sequence, rep(2, nrow1))
SID <- rep(tab361$SID, rep(2, nrow1))
Period <- rep(1:2, nrow1)
Drug <- rep(" ", nrow1*2)
y <- double(nrow1*2)

for (i in seq(nrow1)) {
if (tab361$Sequence[i] == "RT") {
Drug[i*2-1] = "R"
Drug[i*2] = "T"
} else {
Drug[i*2-1] = "T"
Drug[i*2] = "R"
}
y[i*2-1] = tab361$Period1[i]
y[i*2] = tab361$Period2[i]
}

tab361.2 <- data.frame(Sequence=sequence, SID, Period=as.factor(Period), Drug, y)

fm1.lme <- lme(y ~ Sequence+Period+Drug, data=tab361.2, random=~1 | SID)
anova(fm1.lme)

            numDF denDF  F-value p-value
(Intercept)     1    22 431.7741  <.0001
Sequence        1    22   0.3745  0.5468
Period          1    22   0.2151  0.6474
Drug            1    22   0.3754  0.5463

Split-plot モデル


fm2.aov <- aov(y ~ Sequence+Period+Drug+Error(factor(SID)), tab361.2)
summary(fm2.aov)

Error: factor(SID)
          Df  Sum Sq Mean Sq F value Pr(>F)
Sequence   1   276.0   276.0  0.3745 0.5468
Residuals 22 16211.5   736.9               

Error: Within
          Df Sum Sq Mean Sq F value Pr(>F)
Period     1   36.0    36.0  0.2151 0.6474
Drug       1   62.8    62.8  0.3754 0.5463
Residuals 22 3679.4   167.2

参照