a bit corrected workaround [RSABE / ABEL]

posted by mittyri – Russia, 2023-07-08 00:52 (465 d 13:16 ago) – Posting: # 23663
Views: 2,971

Hi Helmut!

❝ if (ds == "per4full") {

❝   # now the equivalent of SAS code for R-R, dlat analysis

❝   m2 <- lm(RR ~ seq, data = data_r)

❝   dfRR <- m2$df.residual

❝   s2wR <- summary(m2)$sigma^2 / 2

❝ } else {

❝   # workaround because lm() with only one sequence not possible

❝   # make a column with intra-subject variances

❝   for (i in 1:nrow(data_r)) {

❝     data_r$varR[i] <- var(c(data_r$logpk.R1[i],

❝                             data_r$logpk.R2[i]), na.rm = TRUE)

❝   }

❝   dfRR <- nrow(data_r) - 2

❝   s2wR <- mean(data_r$varR)

❝ }


I suggest to substitute the workaround to dinosaur method:
  sumsq <- 0
  for (Seq in unique(data_r$seq)) {
    CurrentData <- data_r$RR[data_r$seq == Seq]
    sumsq <- sumsq + sum((CurrentData-mean(CurrentData))^2)
  }
  NSeqs <- length(unique(data_r$seq))
  s2wR    <- sumsq/2/(nrow(data_r) - NSeqs) 
  dfRR    <- nrow(data_r) - NSeqs


at least it gives exactly the same results as classical one.
Yes, ABE is still under fire, the best approach you've found is here

Sorry, right now don't have a clue regarding differences with Winnonlin in RSABE part

Kind regards,
Mittyri

Complete thread:

UA Flag
Activity
 Admin contact
23,258 posts in 4,886 threads, 1,671 registered users;
69 visitors (0 registered, 69 guests [including 8 identified bots]).
Forum time: 14:08 CEST (Europe/Vienna)

Tortured data will confess to anything.    Fredric Menger

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