fixed or mixed effects model [BE/BA News]

posted by Helmut Homepage – Vienna, Austria, 2024-09-10 10:12 (82 d 08:22 ago) – Posting: # 24197
Views: 2,186

Hi BEQool,

partly updated script (change below # aggregate results). Then:

dropouts <- 0
missings <- 0

CV           : 0.225
T/R-ratio    : 0.95
lower limit  : 0.8000
upper limit  : 1.2500
power        : at least 0.8
alpha        : 0.0500
n            : 24

 data     package  function subject df method        PE       lower    upper     width   
 balanced stats    lm       fixed   22 Residual      93.71542 85.34248 102.90983 17.56735
 balanced nlme     lme      random  22 Residual      93.71542 85.34247 102.90983 17.56736
 balanced lmerTest lmer     random  22 Satterthwaite 93.71542 85.34248 102.90983 17.56735
 balanced lmerTest lmer     random  22 Kenward-Roger 93.71542 85.34248 102.90983 17.56735

df    : degrees of freedom =
        n – 2 for Residual, approximated by Satterthwaite and Kenward-Roger
method: df method applied
PE    : Point Estimate
lower : lower limit of the 90% CI
upper : upper limit of the 90% CI


dropouts <- 1
missings <- 0

CV           : 0.225
T/R-ratio    : 0.95
lower limit  : 0.8000
upper limit  : 1.2500
power        : at least 0.8
alpha        : 0.0500
n            : 24
dropout(s)   :  1 (both periods)

 data       package  function subject df method        PE      lower    upper     width   
 imbalanced stats    lm       fixed   21 Residual      92.9679 84.36634 102.44643 18.08008
 imbalanced nlme     lme      random  21 Residual      92.9679 84.36634 102.44644 18.08010
 imbalanced lmerTest lmer     random  21 Satterthwaite 92.9679 84.36634 102.44643 18.08008
 imbalanced lmerTest lmer     random  21 Kenward-Roger 92.9679 84.36634 102.44643 18.08008

df    : degrees of freedom =
        n – 2 for Residual, approximated by Satterthwaite and Kenward-Roger
method: df method applied
PE    : Point Estimate
lower : lower limit of the 90% CI
upper : upper limit of the 90% CI


dropouts <- 1
missings <- 1

CV           : 0.225
T/R-ratio    : 0.95
lower limit  : 0.8000
upper limit  : 1.2500
power        : at least 0.8
alpha        : 0.0500
n            : 24
dropout(s)   :  1 (both periods)
missing(s)   :  1 (second period)

 data           package  function subject df   method        PE       lower    upper     width   
 imbal, incompl stats    lm       fixed   20.0 Residual      92.19586 83.31751 102.02028 18.70277
 imbal, incompl nlme     lme      random  20.0 Residual      92.03122 83.19633 101.80431 18.60798
 imbal, incompl lmerTest lmer     random  20.2 Satterthwaite 92.03122 83.20136 101.79815 18.59679
 imbal, incompl lmerTest lmer     random  20.1 Kenward-Roger 92.03122 83.19399 101.80718 18.61319

df    : degrees of freedom =
        n – 2 for Residual, approximated by Satterthwaite and Kenward-Roger
method: df method applied
PE    : Point Estimate
lower : lower limit of the 90% CI
upper : upper limit of the 90% CI




if (dropouts == 0 & missings == 0) {
  res <- data.frame(data = rep("balanced", 4),
                    package = "", FUN = "", subject = "", df = NA_real_,
                    method = "", PE = NA_real_, lower = NA_real_,
                    upper = NA_real_, width = NA_real_)
  res[1:4,  2:9] <- tmp0
}
if (dropouts > 0 & missings == 0) {
  res <- data.frame(data = rep("imbalanced", 4),
                    package = "", FUN = "", subject = "", df = NA_real_,
                    method = "", PE = NA_real_, lower = NA_real_,
                    upper = NA_real_, width = NA_real_)
  res[1:4,  2:9] <- tmp1
}
if (dropouts > 0 & missings > 0) {
  res <- data.frame(data = rep("imbal, incompl", 4),
                      package = "", FUN = "", subject = "", df = NA_real_,
                      method = "", PE = NA_real_, lower = NA_real_,
                      upper = NA_real_, width = NA_real_)
    res[1:4,  2:9] <- tmp2
}
TODO: dropouts == 0 & missings > 0
res[, 5]       <- round(res[, 5], 1)
res[, 10]      <- res[, 9] - res[, 8] res[, 7:10]    <- round(res[, 7:10], 5)
names(res)[3]  <- "function"
t1             <- paste("CV           :", sprintf("%.4g", CV),
                        "\nT/R-ratio    :", sprintf("%.4g", theta0),
                        "\nlower limit  :", sprintf("%.4f", theta1),
                        "\nupper limit  :", sprintf("%.4f", theta2),
                        "\npower        : at least", sprintf("%.4g", target),
                        "\nalpha        :", sprintf("%.4f", alpha),
                        "\nn            :", n)
if (dropouts > 0)
  t1 <- paste(t1, "\ndropout(s)   :", sprintf("%2i", dropouts), "(both periods)")
if (missings > 0)
  t1 <- paste(t1, "\nmissing(s)   :", sprintf("%2i", missings), "(second period)")
if (!per.effect[2] == 0)
  t1 <- paste(t1, "\nperiod effect:", per.effect[2])
if (!carryover[1] == 0 & !carryover[2] == 0)
  t1 <- paste(t1, "\ncarryover    :", paste(carryover, collapse = ", "))
t1             <- paste(t1, "\n\n")
t2             <- paste("\ndf    : degrees of freedom =",
                        "\n        n – 2 for Residual,",
                        "approximated by Satterthwaite and Kenward-Roger",
                        "\nmethod: df method applied",
                        "\nPE    : Point Estimate",
                        "\nlower :",
                        sprintf("lower limit of the %.4g%% CI", 100*(1-2*alpha)),
                        "\nupper :",
                        sprintf("upper limit of the %.4g%% CI\n", 100*(1-2*alpha)))
cat(t1); print(res, row.names = FALSE, right = FALSE); cat(t2)


Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

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

Complete thread:

UA Flag
Activity
 Admin contact
23,328 posts in 4,898 threads, 1,662 registered users;
95 visitors (0 registered, 95 guests [including 10 identified bots]).
Forum time: 17:34 CET (Europe/Vienna)

Satisfaction of one’s curiosity is one of the greatest sources
of happiness in life.    Linus Pauling

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5