Helmut
★★★
avatar
Homepage
Vienna, Austria,
2012-12-27 17:21
(3033 d 13:39 ago)

Posting: # 9761
Views: 8,066
 

 Imbalanced Xovers: α-inflation? [General Sta­tis­tics]

Dear all,

one of my stat-pro friends regularly mumbled α-inflation!” when I mention imbalanced cross-overs but failed to give a concise explanation – we quickly moved to more interestic topics (NLYW etc.) instead. Is this an urban myth or not? Does anybody know a reference? Of course I could fire up some sim’s – but I don’t want to reinvent the wheel.

Dif-tor heh smusma 🖖
Helmut Schütz
[image]

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

Denmark,
2012-12-28 09:30
(3032 d 21:29 ago)

@ Helmut
Posting: # 9762
Views: 7,225
 

 Imbalanced Xovers: α-inflation?

Hi Helmut,

not sure I follow you. Although partitioning of SS is an issue, imbalance per se is not causing inflation of alpha in simple crossovers. The phenomenon has not been studied or published for 2-stage designs, though.
Did you mean to say something else?

Pass or fail!
ElMaestro
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2012-12-28 14:37
(3032 d 16:23 ago)

@ ElMaestro
Posting: # 9763
Views: 7,151
 

 Imbalanced Xovers: α-inflation?

Hi ElMaestro,

» […] imbalance per se is not causing inflation of alpha in simple crossovers.

Do you know that or do you assume it?

» The phenomenon has not been studied or published for 2-stage designs, though.

Yep. Mdme Potvin:

“[…] each stage was assumed to be balanced with respect to sequence.”

Since I want to avoid troubles with regulators

“The imbalanced case is outside the validated framework. The applicant should justify that the consumers’s risk is preserved in the actual study.”

I recommend my clients to randomize the second stage in such a way that imbalance in the first stage is counteracted (e.g., stage 1 TR|RT 10|12, ntotal 32, stage 2 TR|RT 6|4).

» Did you mean to say something else?

I was just interested in common 2,2,2 cross-overs.

Dif-tor heh smusma 🖖
Helmut Schütz
[image]

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

Denmark,
2012-12-29 08:44
(3031 d 22:16 ago)

@ Helmut
Posting: # 9764
Views: 7,088
 

 please explain

Hi Helmut,


I am still not sure I follow you. Can you put a few more words to your post?
Are we talking one-stage or two-stage designs? Imbalance has not been studied for two-stage designs.

Pass or fail!
ElMaestro
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2012-12-29 15:42
(3031 d 15:17 ago)

@ ElMaestro
Posting: # 9765
Views: 7,066
 

 I’ll try

Hi ElMaestro,

» Are we talking one-stage or two-stage designs?

One stage (fixed sample 2,2,2 cross-over). Duno what to say else that I did in my original post. Is it true or not that α might be inflated in imbalanced studies? I’m not talking about nominal α (which is ≤0.05) but the one we can expect using the usual methods… If this is just a rumor, fine. If not, how large an inflation can we expect?

» Imbalance has not been studied for two-stage designs.

Yep. [image] BTW :-D

Dif-tor heh smusma 🖖
Helmut Schütz
[image]

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

Berlin, Germany,
2012-12-31 13:50
(3029 d 17:10 ago)

@ Helmut
Posting: # 9768
Views: 6,813
 

 Imbalanced Xovers: α-inflation?

Dear Helmut,

» one of my stat-pro friends regularly mumbled α-inflation!” when I mention imbalanced cross-overs but failed to give a concise explanation – we quickly moved to more interestic topics (NLYW etc.) instead. Is this an urban myth or not?

Never heard about such a theme like α-inflation!” for imbalanced cross-overs.
So I think your stat-pro friend should justify his mumbling (innocent until proven guilty - at least in under German law) before you waste computer time and energy for over-heating your machine(s).

Regards,

Detlew
d_labes
★★★

Berlin, Germany,
2013-01-09 15:23
(3020 d 15:36 ago)

@ Helmut
Posting: # 9803
Views: 6,921
 

 One Mio sims of 2x2x2 in R in under 1 sec

Dear Helmut,

from this post I know that you are working on simulations for the 2x2x2 crossover, at least on balanced design.

Do you believe the subject line?
If not, have a look on the following code :cool::
# simulate 2x2x2 crossover studies with log-normal data
# Author: dlabes
###############################################################################
# We are simulating via the way described in the MATOST paper
# namely via the distribution properties of the stats that are necessary
# to calculate the 90% CI. Assuming a log-normal distribution of the PK metrics
# it follows that the sample mean of ln(T)-ln(R) is normal distributed with
# mean=log(GMR) and sd=sqrt(2*mse/n) in case of a balanced 2x2 crossover.
# The sample mse is idependently distributet via a chi-squared distribution
# of df*mses/mse with df=n-2. mse and GMR are the assumed true vales.
#
# For unbalanced crossover designs the question is: We are using LSMeans.
# Are the distribution properties the same except that 2/n has to be replaced
# by 0.5*(1/n1+1/n2)? I think so but are not quite sure.

# 'commercial' rounding: 0-4 down and 5-9 up

cround <- function(x, digits=0) sign(x)*trunc(abs(x)*10^digits + 0.5)/10^digits

power.sim2x2 <- function(CV, GMR, n, nsims=1E6, alpha=0.05, lBEL=0.8, uBEL=1.25,
                         roundit=FALSE, details=FALSE)
{
  ptm <- proc.time()
  # n is total if given as simple number
  # to be correct n must then be even!
 
  if (length(n)==1) {
    nsum <- n
    fact <- 2/n
  }
  if (length(n)==2) {
    nsum <- sum(n)
    fact <- 0.5*sum(1/n)
  }
  mse    <- log(1.0 + CV^2)
  df     <- nsum-2
  tval   <- qt(1-alpha,df)
  # Attention! With nsims=1E8 memory of my machine (4 GB) is too low
  # Thus work in chunks of 1E6 if nsims>1E6.

  chunks <- 1
  ns     <- nsims
  if (nsims>1e6) {
    chunks <- trunc(nsims/1E6)
    ns     <- 1E6
    if (chunks*1e6!=nsims){
      nsims <- chunks*1e6
      warning("nsims truncated to", nsims)
    }
  }
  BEcount <- 0
  sdm     <- sqrt(fact*mse)
  mlog    <- log(GMR)
  for (i in 1:chunks)
  { 
    # simulate sample mean via its normal distribution
    means  <- rnorm(ns, mean=mlog, sd=sdm)
    # simulate sample mse via chi-square distribution of df*mses/mse
    mses   <- mse*rchisq(ns,df)/df
    hw     <- tval*sqrt(fact*mses)
    lCL <- means - hw
    uCL <- means + hw
    # point  <- exp(means)
    lCL    <- exp(lCL)
    uCL    <- exp(uCL)
    if (roundit){
      # use our commercial rounding
      lCL  <- cround(lCL,4)
      uCL  <- cround(uCL,4)
      # in case of rounding we use also the EMA rule for BE
      BE     <- (lBEL<=lCL & uCL<=uBEL)
    } else {
      BE     <- (lBEL<lCL & uCL<uBEL)
    }
    BEcount <- BEcount + sum(BE)
  }
  if (details) {
    cat(nsims,"sims. Time elapsed (sec):\n")
    print(proc.time()-ptm)
  }
  BEcount/nsims
}


Using these functions:
require(PowerTOST)
power.TOST(CV=0.3, n=12, theta0=1.25)
[1] 0.03374229
set.seed(123)
power.sim2x2(CV=0.3, n=12, GMR=1.25, details=T)
1e+06 sims. Time elapsed (sec):
   user  system elapsed
   0.50    0.05    0.55
[1] 0.033578
set.seed(123)
power.sim2x2(CV=0.3, n=12, GMR=1.25, roundit=T)
[1] 0.033605

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-09 16:10
(3020 d 14:49 ago)

@ d_labes
Posting: # 9805
Views: 6,593
 

 Wow!

Dear Detlew!

» Do you believe the subject line?

First: no.

» If not, have a look on the following code :cool::

Second: yes. Unbelievable.

» power.sim2x2(CV=0.3, n=12, GMR=1.25, details=T)
» 1e+06 sims. Time elapsed (sec):
»    user  system elapsed
»    0.50    0.05    0.55
» [1] 0.033578

Amazing. With roundit=T I got 0.033605. Same value if I switch lines 65–66 to R’s round(). With my original code I got 0.033236 (unrounded) and 0.033786 (R’s rounding), but run-time was ~30 minutes.
Concerning the question at the top of your source code: I think so but I’m not sure as well. BTW, couldn’t figure out how to modify the code for imbalanced sequences.

Just discovered that I’m not the first simulator. See Chapter 4.2.1 of Chow & Liu (any edition).

Dif-tor heh smusma 🖖
Helmut Schütz
[image]

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

Berlin, Germany,
2013-01-09 16:56
(3020 d 14:03 ago)

@ Helmut
Posting: # 9806
Views: 6,590
 

 Unbalanced

Dear Helmut!

» With roundit=T I got 0.033605.
Me too.
» Same value if I switch lines 65–66 to R’s round(). With my original code I got (R’s rounding) 0.033786, but run-time was ~30 minutes.

Your observation that cround() and round() work equal if rounded to 4 decimals.

» BTW, couldn’t figure out how to modify the code for imbalanced sequences.

Described in the question for unbalanced designs.
Based on this:
power2.TOST(CV=0.3,n=c(4,7),theta0=1.25)
[1] 0.02718537
set.seed(123)
power.sim2x2(CV=0.3, n=c(4,7), GMR=1.25)
[1] 0.027217

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-09 18:07
(3020 d 12:53 ago)

@ d_labes
Posting: # 9807
Views: 6,603
 

 α-inflation ≈ urban myth

Dear Detlew!

» » Same value if I switch lines 65–66 to R’s round().
» Your observation that cround() and round() work equal if rounded to 4 decimals.

Oh no! So we can abandon the 1 mio function calls and stick to round(). ;-)

» power.sim2x2(CV=0.3, n=c(4,7), GMR=1.25)

I see. Didn’t understand your lines 6–7.

Now let’s see what I got for the extreme ’corners’ and the center of my grid. All sim’s with the same seed. Values in red are significantly >0.05…
                magical mystery code         my code          power.TOST
                rounded    unrounded   rounded    unrounded      exact
n 12, CV 0.06   0.049432   0.049839    0.050503   0.050331     0.050000
n 60, CV 0.06   0.050579   0.050231    0.050495   0.049924     0.050000
n 30, CV 0.25   0.050021   0.049946    0.050046   0.050309     0.050000
n 12, CV 1.0    0.000034   0.000034    0.000025   0.000019     0.000025
n 60, CV 1.0    0.001920   0.001913    0.001936   0.001858     0.001904

Rounding is evil – at least if we want to compare results with expected (theoretical) ones.

Extremely imbalanced sequences, where n1+n2=n from above. Arrows denote direction of the change compared to balanced cases.
                magical mystery code   power2.TOST
                rounded    unrounded      exact
 8/ 4, CV 0.06  0.049839  0.049981    0.050000
40/20, CV 0.06  0.050558  0.050231    0.050000
20/10, CV 0.25  0.050017  0.049946    0.049999
 8/ 4, CV 1.0   0.000017  0.000017    0.000014
40/20, CV 1.0   0.000548  0.000545    0.000554

Can’t see any relevant α-inflation – on the contrary (see esp. power(2).TOST). I think Martin ows my a beer. THX for the code; saved me two days of sim’s.

Dif-tor heh smusma 🖖
Helmut Schütz
[image]

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

Berlin, Germany,
2013-01-10 11:07
(3019 d 19:53 ago)

@ Helmut
Posting: # 9813
Views: 6,484
 

 Beer

Dear Helmut!

» Can’t see any relevant α-inflation – on the contrary (see esp. power(2).TOST). I think Martin ows my a beer.

One caveat: Both power2.TOST() and the "magical mystery code" rely on the positive answer to my question in the comments above the code. To get your beer :party: be prepared (hint: period-by-sequence means, Hauschke, Steinijans, Pigeot Chapter 3.4.2.2).

» THX for the code; saved me two days of sim’s.

How much is your daily salary? I will give you the details of my bank account :-D.

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-10 13:45
(3019 d 17:15 ago)

@ d_labes
Posting: # 9815
Views: 6,593
 

 Beer

Dear Detlew!

» One caveat: Both power2.TOST() and the "magical mystery code" rely on the positive answer to my question in the comments above the code.

Right. Beyond my capabilities.

» hint: period-by-sequence means, Hauschke, Steinijans, Pigeot Chapter 3.4.2.2.

OK, one of the assumptions I’m comfortable with.

» » THX for the code; saved me two days of sim’s.
» How much is your daily salary? I will give you the details of my bank account :-D.

Daily salary: As a one-man band no salary at all. Record honorary € 5,000.–/day, but sometimes zero for two months. I run sim’s to satisfy my own curiosity which is difficult to rate. Once I’ll be in Berlin next time beers on my bill. :smoke:


Edit: Talked to Martin. He apologized and will pay our beers.

Dif-tor heh smusma 🖖
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Activity
 Admin contact
21,419 posts in 4,475 threads, 1,510 registered users;
online 20 (0 registered, 20 guests [including 6 identified bots]).
Forum time: Sunday 08:00 CEST (Europe/Vienna)

Nothing fails like success because you do not learn anything from it.
The only thing we ever learn from is failure.
Success only confirms our superstitions.    Kenneth E. Boulding

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