Simulation of inter-subject variability in replicate study [RSABE / ABEL]

posted by Shuanghe  – Spain, 2025-12-14 18:35 (171 d 10:36 ago) – Posting: # 24532
Views: 2,498

Hi all,

I have several questions regarding the simulation of the inter-subject variability in the 2x2x4 replicate study. It's a long post, so let's use concrete example so it's easier to discuss.

Imagine I need to simulate a 2x2x4 study with n = 24 subjects (so 12 for TRTR and 12 for RTRT). The mean Cmax of test and reference is 100 ng/mL, intra-subject variability for test is sd.t = 0.2 and for reference is sd.r = 0.1. Here the variability is expressed as standard deviation (SD), not CV.
cmax.r <- rnorm(48, mean = log(100), sd = 0.1)
cmax.t <- rnorm(48, mean = log(100), sd = 0.2)

This will simulate 48 Cmax values for T and R. With a bit coding, we can generate TRTR/RTRT sequences and randomly assign 24 subjects to those sequences with corresponding period and Cmax values. We can back-calculate the within-subject variability of T and R either using EMA's method (e.g., using only reference data for within-subject variability of reference as described in Clinical pharmacology and pharmacokinetics: questions and answers.) or FDA's method (e.g., described in the appendix C of the BE guidance). Easy enough, so far so good.

Q1: In this case, based on those population parameters described above, what is the expected inter-subject variability? Is there mathematical formula to get the between-subject SD of T and R? or pooled SD?

Q2: If there's no mathematical derivation for between-subject SD, I think that we can estimate them using R. But how?

One way that I am thinking is to use EMA's method, removing test product from the data set and do ANOVA as described in EMA's Q&A.
m.ref <- anova(lm(log(cmax) ~ sequence + subject %in% sequence + period, data = d.ref))
The code above should give us the within and between-subject SD of reference with swr = sqrt(MSResidual) and sbr = sqrt((MSSubject(seq) - MSResidual)/2), where swr and sbr are within-and between-SD of reference, respectively. Similarly we can do it for the test. And in case MSSubject(seq) < MSResidual, we can try what Detlew described in another post to avoid negative variance.

Q3: Is this a correct approach? If not, what's the correct one?

Now comes to simulation. Imagine in addition to what I described above for simulating Cmax of T and R with mean value of 100 ng/mL, sd.t = 0.2 and sd.r = 0.1, I also want to introduce between-subject SD for T and R, say sd.bt = 0.4 and sd.br = 0.2, where sd.bt and sd.br are between-subject SD for T and R.

Q4: How do we do it?

I saw that Helmut did it as follows in one of his articles (Helmut, it's Simulations 101 but the link causes Error 406 :confused:.) for simulating the 2x2x2 crossover study.
T  <- rnorm(n = n, mean = log(theta0), sd = sd)
R  <- rnorm(n = n, mean = 0, sd = sd)
TR <- rnorm(n = n, mean = 0, sd = sd.b)
T  <- T + TR
R  <- R + TR

where sd.b is the between-subject SD if I understood it correctly.

However, when I tried to do it similarly for 2x2x4 as follows and back-calculate the within and between SD, the results doesn't match expectation at all because the between-subject SD fromANOVA is extremely small, instead of around the expected values of 0.2 or 0.4.
cmax.r <- rnorm(48, mean = log(100), sd = 0.1)
cmax.t <- rnorm(48, mean = log(100), sd = 0.2)
cmax.br <- rnorm(48, mean = log(100), sd = 0.2) # for reference
cmax.bt <- rnorm(48, mean = log(100), sd = 0.4) # for test
# I need the concentration in original scale, not log-transformed
cmax.r <- exp(cmax.r + cmax.br)
cmax.t <- exp(cmax.t + cmax.bt)

Q5: What went wrong? Should the mean value for between-subject SD of T and R always 0 instead of using the same value as T and R?


Edit: Category changed. [Helmut]

All the best,
Shuanghe

Complete thread:

UA Flag
Activity
 Admin contact
23,653 posts in 4,991 threads, 1,571 registered users;
432 visitors (0 registered, 432 guests [including 26 identified bots]).
Forum time: 06:11 CEST (Europe/Vienna)

I’m all in favor of the democratic principle
that one idiot is as good as one genius, but I draw the line
when someone takes the next step and concludes
that two idiots are better than one genius.    Leo Szilard

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