a bit corrected workaround [RSABE / ABEL]

posted by mittyri – Russia, 2023-07-08 00:52 (316 d 12:05 ago) – Posting: # 23663
Views: 1,865

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,029 posts in 4,834 threads, 1,644 registered users;
31 visitors (0 registered, 31 guests [including 6 identified bots]).
Forum time: 12:58 CEST (Europe/Vienna)

We must be careful not to confuse data with the abstractions
we use to analyze them.    William James

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