mixed in R (EMA B ≠ FDA) [Design Issues]
❝ If I remember correctly we were struggling with FDA model where sophisticated 'repeated' statement exists.
❝ We successfully crosschecked EMA method B (simple mixed effects model with a Subject as random effect).
Are you reminding Detlew and me obout our TODO-list?
❝ So linear mixed effects models are possible until FDA-style is required .
Yes, but that’s the point. However, recycled our code:
library(lmerTest) # (requires lme4, Matrix)
dta <- read.table("exam45.dat", header=TRUE, na.strings="99999",
colClasses=c(rep("factor", 4), rep("numeric", 2)))
names(dta)[4] <- "treatment"
TR.only <- dta[dta$treatment != "S", ]
ci <- data.frame(rep(NA, 2), rep(NA, 4))
res <- data.frame(method=c(rep("pooled", 2), rep("IBD", 2)),
PE=NA, CL.lo=NA, CL.hi=NA, CV=NA,
DFM=rep(c("Satterthwaite", "Kenward-Roger"), 2),
DF=NA, stringsAsFactors=FALSE)
for (j in 1:4) {
if (j == 1) { # pooled (all at once)
muddle <- lmer(log(AUC) ~ sequence + period + treatment + (1|subject),
data=dta)
}
if (j == 3) { # IBD (S excluded)
muddle <- lmer(log(AUC) ~ sequence + period + treatment + (1|subject),
data=TR.only)
}
sum.muddle <- summary(muddle, ddf=res$DFM[j])
log.pe <- sum.muddle$coefficients["treatmentT", "Estimate"]
ci[j, 1:2] <- round(100*exp(log.pe + c(-1, +1) *
qt(1-0.05, sum.muddle$coef["treatmentT", "df"]) *
sum.muddle$coef["treatmentT", "Std. Error"]), 2)
res$PE[j] <- round(100*exp(log.pe), 2)
res$CL.lo[j] <- ci[j, 1]; res$CL.hi[j] <- ci[j, 2]
res$CV[j] <- round(100*sqrt(exp(sum.muddle$devcomp$cmp[["sigmaREML"]]^2)-1), 2)
res$DF[j] <- signif(sum.muddle$coefficients["treatmentT", "df"], 5)
}
print(res, row.names=FALSE)
Gives:
Method PE CL.lo CL.hi CV DFM DF
pooled 116.15 108.97 123.81 21.20 Satterthwaite 115.040
pooled 116.15 108.97 123.81 21.20 Kenward-Roger 114.630
IBD 116.05 108.92 123.65 20.84 Satterthwaite 56.823
IBD 116.05 108.91 123.65 20.84 Kenward-Roger 56.468
Similar ≠ same.
Though the DFs are slightly different, the CIs look only identical due to rounding.
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- Three-way crossover BABE Studies acfalcao 2007-09-16 22:34 [Design Issues]
- Three-way crossover example data set Helmut 2007-09-17 20:47
- Three-way crossover example data set acfalcao 2007-09-17 23:02
- Three-way crossover example data set Helmut 2007-09-18 12:47
- Three-way crossover (WinNonlin) Nirali 2007-09-21 06:49
- Three-way crossover (WinNonlin) Helmut 2007-09-21 13:04
- Three-way crossover (WinNonlin) Nirali 2007-09-25 08:05
- Three-way crossover (WinNonlin) Helmut 2007-09-25 13:15
- Three-way crossover (WinNonlin) Nirali 2007-09-25 08:05
- Three-way crossover (WinNonlin) Helmut 2007-09-21 13:04
- Three-way crossover example data set Irene_I 2018-06-07 11:09
- Three-way crossover example data set Helmut 2018-06-07 13:04
- Three-way crossover example data set Irene_I 2018-06-08 11:09
- Three-way crossover example data set Irene_I 2018-06-12 09:21
- Leave-One-Out (IBD) Helmut 2018-06-12 12:42
- Leave-One-Out (IBD) Irene_I 2018-06-13 05:02
- Impact of pooled variance (bias, CI) Helmut 2018-06-13 15:02
- carry (over?) d_labes 2018-06-13 15:31
- Leave-One-Out (IBD) Irene_I 2018-06-13 05:02
- Leave-One-Out (IBD) Helmut 2018-06-12 12:42
- Three-way crossover example data set Helmut 2018-06-07 13:04
- Three-way crossover (WinNonlin) Nirali 2007-09-21 06:49
- Three-way crossover example data set Helmut 2007-09-18 12:47
- Pseudo-periods ElAlumno 2019-03-14 23:40
- Pseudo-periods Helmut 2019-03-15 00:47
- Two‐at‐a‐Time analysis in R ElAlumno 2019-03-22 21:59
- fixed & mixed (dammit!) and a request to SASians Helmut 2019-03-23 01:03
- Pooled vs IBD T-R in SAS from non-SASian mittyri 2019-03-23 23:13
- Pooled vs IBD T-R in SAS from non-SASian Helmut 2019-03-23 23:36
- mixed in R mittyri 2019-03-23 23:50
- mixed in R (EMA B ≠ FDA)Helmut 2019-03-24 01:23
- Pooled vs IBD T-R in SAS from non-SASian mittyri 2019-03-23 23:13
- fixed & mixed (dammit!) and a request to SASians Helmut 2019-03-23 01:03
- Two‐at‐a‐Time analysis in R ElAlumno 2019-03-22 21:59
- Pseudo-periods Helmut 2019-03-15 00:47
- Williams design 3-way Brus 2021-06-09 16:48
- Williams design 3-way Helmut 2021-06-09 17:48
- Williams design 3-way Brus 2021-06-10 14:33
- Williams design 3-way Helmut 2021-06-10 15:03
- Williams design 3-way vezz 2021-06-10 17:23
- Williams design 3-way Helmut 2021-06-10 20:14
- Williams design 3-way vezz 2021-06-11 09:11
- Williams design 3-way Brus 2021-06-11 12:19
- Williams design 3-way Relaxation 2021-06-11 12:42
- Period effects in general Helmut 2021-06-11 15:41
- Williams design 3-way vezz 2021-06-11 16:56
- Williams design 3-way vezz 2021-06-11 09:11
- Williams design 3-way Helmut 2021-06-10 20:14
- Williams design 3-way vezz 2021-06-10 17:23
- Williams design 3-way Helmut 2021-06-10 15:03
- Williams design 3-way Brus 2021-06-10 14:33
- Williams design 3-way Helmut 2021-06-09 17:48
- Three-way crossover example data set acfalcao 2007-09-17 23:02
- Three-way crossover example data set Helmut 2007-09-17 20:47