mixed in R (EMA B ≠ FDA) [Design Issues]

posted by Helmut Homepage – Vienna, Austria, 2019-03-24 01:23  – Posting: # 20077
Views: 2,904

Hi mittyri,

» 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 :cool:.

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.

Cheers,
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. ☼
Science Quotes

Complete thread:

Activity
 Mix view
Bioequivalence and Bioavailability Forum |  Admin contact
19,688 posts in 4,178 threads, 1,353 registered users;
online 5 (0 registered, 5 guests [including 4 identified bots]).
Forum time (Europe/Vienna): 21:00 CEST

Power. That which statisticians are always calculating
but never have.    Stephen Senn

The BIOEQUIVALENCE / BIOAVAILABILITY FORUM is hosted by
BEBAC Ing. Helmut Schütz
HTML5