Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-01 17:51
(4126 d 04:30 ago)

Posting: # 9773
Views: 12,647
 

 Rounding [Software]

Hi Simulators!

How does your software round? Mine:
Excel 2000:       round(125.005, 2) → 125.01
OO Calc:          round(125.005, 2) → 125.01
Gnumeric 1.10.16: round(125.005, 2) → 125.01
WinNonlin 5.3:    round(125.005, 2) → 125.01
Phoenix 6.3:      round(125.005, 2) → 125.01
JavaScript:       Math.round(125.005*100)/100 → 125.01
PHP:              round(125.005, 2) → 125.01
PHP ≥5.3.0:       round(125.005, 2, PHP_ROUND_HALF_UP) → 125.01
                  round(125.005, 2, PHP_ROUND_HALF_DOWN) → 125.00
                  round(125.005, 2, PHP_ROUND_HALF_EVEN) → 125.00
                  round(125.005, 2, PHP_ROUND_HALF_ODD) → 125.01
R 2.15.2:         round(125.005, 2) → 125.00

R claims to be compliant with IEC 60559. In normal life not sooo important, but in simulations. Example (106 sim’s, empiric alpha ~ T/R 1.25 in conventional balanced cross-overs).
n   CV   alpha        alpha
         no rounding  CI rounded
42  15%  0.049842     0.050746 (sig. >0.05)
36  17%  0.050010     0.050706 (sig. >0.05)


@ElMaestro: Do you round in C?

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
d_labes
★★★

Berlin, Germany,
2013-01-02 13:51
(4125 d 08:29 ago)

(edited by d_labes on 2013-01-03 09:31)
@ Helmut
Posting: # 9777
Views: 11,713
 

 Rounding

Hi Helmut!

❝ How does your software round?


I'm currently not in reach of my SAS but I strongly suppose that it will give 125.01 if one uses the ordinary ROUND() function. To be in accordance with the R method (or other software) one has to use the ROUNDE() function which rounds to even.

❝ Mine:

Excel 2000:       round(125.005, 2) → 125.01


Excel 2010:       round(125.005,2)    → 125.01
[edit]Just checked (03-Jan-2013)
SAS 9.2:          round(125.005,0.01) → 125.01
(Note the definition of rounding to 2 decimals as rounding to multiples of 0.01)
[/edit]

❝ OO Calc:          round(125.005, 2) → 125.01

❝ ...

❝ R 2.15.2:         round(125.005, 2) → 125.00


Seems the R folks did it again the way different from what all others do :cool:.

❝ In normal life not sooo important


A more drastically example, may be important also in normal life I think:
round(c(0.5,1.5,2.5,3.5,4.5,5.5),0)
[1] 0 2 2 4 4 6

At least in Germany one would expect:
[1] 1 2 3 4 5 6

❝ ... but in simulations. Example (106 sim’s, empiric alpha ~ T/R 1.25 in conventional balanced cross-overs).

n   CV   alpha        alpha

❝          no rounding  CI rounded

❝ 42  15%  0.049842     0.050746 (sig. >0.05)

❝ 36  17%  0.050010     0.050706 (sig. >0.05)


Wow! Seems rounding the CI anyhow is not such a good idea.
[edit]Also the rounding seems to be implied by regulatory definitions of the acceptance range as 80.00 - 125.00 (EMA & FDA)![/edit]

But ... IMHO this must be independent from the used rounding method for 5 except the magnitude of deviation from the not rounded results since all the other results >125.0000 - 125.0049 will be also counted as BE if rounded and as not BE if not rounded.

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-04 18:35
(4123 d 03:45 ago)

@ d_labes
Posting: # 9786
Views: 11,679
 

 Rounding

Dear Detlew!

❝ SAS 9.2: round(125.005,0.01) → 125.01

(Note the definition of rounding to 2 decimals as rounding to multiples of 0.01)


There is a similar function in Excel (has to be activated in Add-ins: Analysis Toolpak):
mround(125.005,0.01) → 125.01
But – like R:
Maxima: round(125.005*100)/100 → 125.00

❝ A more drastically example, may be important also in normal life I think:

round(c(0.5,1.5,2.5,3.5,4.5,5.5),0)

❝ [1] 0 2 2 4 4 6

❝ At least in Germany one would expect:

[1] 1 2 3 4 5 6


Splendid.

❝ Wow! Seems rounding the CI anyhow is not such a good idea.


Yes. Not so important for the conventional acceptance range, but we have double rounding for NTIDs (AR 90.00–111.11%). Must not forget to state theta2=1.1111 in sampleN.TOST explicitly.

❝ [edit]Also the rounding seems to be implied by regulatory definitions of the acceptance range as 80.00 - 125.00 (EMA & FDA)![/edit]


<nitpick>

Well, the width of FDA's/EMA's AR is not 45% but 125.004–79.995=45.009%…

</nitpick>

❝ But ... IMHO this must be independent from the used rounding method for 5 except the magnitude of deviation from the not rounded results since all the other results >125.0000 - 125.0049 will be also counted as BE if rounded and as not BE if not rounded.


Right. Maybe I will run a set and save individual results to a file. In the meantime I finished my balanced cross-over sim’s. n 12–60, CV 6–100%. With my grid I have 306·106 sim’s each. With rounding I got 24 (7.84%) empiric alphas significantly >0.05; without 11 (3.59%). If I take power.TOST(CV=…, n=…, theta0=1.25) as the gold standard and calculate the %RSE of the simulated alphas I see a positive bias of the rounding again:

            Q I    median   Q III
rounded    -0.110  +0.218  +0.574
unrounded  -0.404  -0.036  +0.325


Jiří showed me another gem. Try

sprintf("%.2f", round(125.005, 2))
sprintf("%.2f", 100*round(1.25005, 4))



Edit: 2012-01-05
After reading a lot of stuff on the net I guess the only way to get “commercial rounding” (the one we learned in school; 1–4 down, 5–9 up) in R without requiring a library is by a function (THX to an anonymous poster):

cround <- function(x,n){
  z    <- abs(x)*10^n
  z    <- z + 0.5
  z    <- trunc(z)
  z    <- z/10^n
  z*sign(x)
}


round(c(79.994, 79.995, 125.004, 125.005), 2)
79.99  80.00 125.00 125.00
cround(c(79.994, 79.995, 125.004, 125.005), 2)
79.99  80.00 125.00 125.01


But note:
round(c(0.79994, 0.79995, 1.25004, 1.25005), 4)
0.7999 0.8000 1.2500 1.2501
cround(c(0.79994, 0.79995, 1.25004, 1.25005), 4)
0.7999 0.8000 1.2500 1.2501


Sometimes R drives me nuts.

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
d_labes
★★★

Berlin, Germany,
2013-01-05 20:25
(4122 d 01:55 ago)

@ Helmut
Posting: # 9787
Views: 11,227
 

 Rounding

Dear Helmut!

❝ ... In the meantime I finished my balanced cross-over sim’s. n 12–60, CV 6–100%. With my grid I have 306·106 sim’s each. With rounding I got 24 (7.84%) empiric alphas significantly >0.05; without 11 (3.59%).


How do you interpret the un-rounded results?
Empirical evidence of an Alpha inflation of TOST :cool:?
Hopefully not.

❝ Sometimes R drives me nuts.


Here I have another one:
round(c(1.2500499999999999, 1.250049999999999999), 4)
[1] 1.2500 1.2501


More trouble spots can be found in "The R inferno".
Should be a must-read for all R-users.

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-05 21:13
(4122 d 01:07 ago)

@ d_labes
Posting: # 9788
Views: 11,255
 

 Rounding

Dear Detlew!

❝ ❝ ... In the meantime I finished my balanced cross-over sim’s. n 12–60, CV 6–100%. With my grid I have 306·106 sim’s each. With rounding I got 24 (7.84%) empiric alphas significantly >0.05; without 11 (3.59%).


❝ How do you interpret the un-rounded results?


The jury is out. I ran two sim’s with identical seeds to compare the results. Nice intermediate result files (33.1MB unrounded, 14MB rounded). Have to find a clever way to filter for the suspects.

❝ Empirical evidence of an Alpha inflation of TOST :cool:?

❝ Hopefully not.


Don’t think so. On the other hand it puts occasional significant alphas I got in Methods B/C/D into perspective.

Sim’s are sim’s are sim’s.

It’s like with lab values. The more your physician requests, the more “*” you’ll get – though not being ill. ;-)

❝ Here I have another one:

round(c(1.2500499999999999, 1.250049999999999999), 4)

[1] 1.2500 1.2501


You are a nasty person.

❝ More trouble spots can be found in "The R inferno".

❝ Should be a must-read for all R-users.


Wow.

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
d_labes
★★★

Berlin, Germany,
2013-01-05 21:57
(4122 d 00:24 ago)

@ Helmut
Posting: # 9789
Views: 11,209
 

 Sim’s are sim’s are sim’s

Dear Helmut!

❝ Sim’s are sim’s are sim’s.


The Lord may give that some regulatory bodies could realize this fundamental Rule of thumb. Remember the story that Potvin Method C was called by them "alpha inflation" because some empirical alpha's of the sims of Potvin et. al. were slight above 0.05.

❝ ❝ Here I have another one:

❝ ❝ round(c(1.2500499999999999, 1.250049999999999999), 4)

❝ ❝ [1] 1.2500 1.2501


❝ You are a nasty person.


You are welcome :-D.

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-06 03:21
(4121 d 18:59 ago)

@ d_labes
Posting: # 9791
Views: 11,304
 

 Another vicious circle

Dear Detlew!

❝ ❝ ... In the meantime I finished my balanced cross-over sim’s. n 12–60, CV 6–100%. With my grid I have 306·106 sim’s each. With rounding I got 24 (7.84%) empiric alphas significantly >0.05; without 11 (3.59%).


❝ How do you interpret the un-rounded results?


Had to have a break. Let’s see what I got from n 12, CV 6%, 106 sim’s:
50331 studies passed when BE was defined as the unrounded upper CL ≤1.25 (αemp n.s.). 50503 studies passed based on round(CLhi,4) ≤1.25 (αemp sign. >0.05). In increasing order (skipping 170):
    Unrounded.lo     Unrounded.hi  Rd.lo  Rd.hi
1.14406215516423 1.25000008857710 1.1441 1.2500

1.16009942086582 1.25004974319996 1.1601 1.2500

and
    Unrounded.lo         Unrounded.hi         Rounded.lo         Rounded.hi
Min.   :1.11998223   Min.   :1.25000009   Min.   :1.12000000   Min.   :1.25
1st Qu.:1.14730961   1st Qu.:1.25001184   1st Qu.:1.14730000   1st Qu.:1.25
Median :1.16346327   Median :1.25002528   Median :1.16345000   Median :1.25
Mean   :1.16222013   Mean   :1.25002554   Mean   :1.16221977   Mean   :1.25
3rd Qu.:1.17608605   3rd Qu.:1.25003838   3rd Qu.:1.17610000   3rd Qu.:1.25
Max.   :1.20299871   Max.   :1.25004974   Max.   :1.20300000   Max.   :1.25


Verdict: Duno. Wasn’t there a guy having a heading “Science vs. Regulations” in one of his slides? I would say the AR is based on the maximum acceptable and BE means 1– ≤ CI ≤ (1–)-1. No fucking rounding here.
It’s soooo convenient* that 100%/0.8 gives an integer. Stupidity starts with rounding the periodic decimal 100%/0.9=111.11% to 111.11% precisely (for Canada’s lumberjacks to 112.00%).
There is no rounding in theoretical statistics at all. So I have mixed feelings.
  • If I don’t round I’m closer to theory and it is less likely to get significant results.
    Mr X will tell me “Nice simulations but not based on our BE criterion.”
  • If I round I get more significant results.
    Mr X will tell me “Nice simulations proving the patient’s risk is not maintained.”

[image]


  • Convenience [sic] was the winning argument when regulations changed from an additive (AR 80–120%) to a multiplicative model (AR 80-125%). Really. See also this slide.

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
d_labes
★★★

Berlin, Germany,
2013-01-07 16:52
(4120 d 05:28 ago)

@ Helmut
Posting: # 9796
Views: 11,114
 

 Where all these numbers came from?

Dear Helmut!

❝ Had to have a break. Let’s see what I got from n 12, CV 6%, 106 sim’s:

❝ 50331 studies passed when BE was defined as the unrounded upper CL ≤1.25 (αemp n.s.). 50503 studies passed based on round(CLhi,4) ≤1.25 (αemp sign. >0.05). In increasing order (skipping 170):

    Unrounded.lo     Unrounded.hi  Rd.lo  Rd.hi

1.14406215516423 1.25000008857710 1.1441 1.2500


1.16009942086582 1.25004974319996 1.1601 1.2500

❝ and


:confused: I'm not certain if I understand your numbers given. How do the above correspond to below? Numbers from cases which were judged BE if rounded and not BE if not rounded?

    Unrounded.lo         Unrounded.hi         Rounded.lo         Rounded.hi

Min.   :1.11998223   Min.   :1.25000009   Min.   :1.12000000   Min.   :1.25

1st Qu.:1.14730961   1st Qu.:1.25001184   1st Qu.:1.14730000   1st Qu.:1.25

Median :1.16346327   Median :1.25002528   Median :1.16345000   Median :1.25

Mean   :1.16222013   Mean   :1.25002554   Mean   :1.16221977   Mean   :1.25

3rd Qu.:1.17608605   3rd Qu.:1.25003838   3rd Qu.:1.17610000   3rd Qu.:1.25

Max.   :1.20299871   Max.   :1.25004974   Max.   :1.20300000   Max.   :1.25


❝ If I round I get more significant results.

❝ Mr X will tell me “Nice simulations proving the patient’s risk is not maintained.”

Augmented with the reply “If and only if one uses your (assuming Mister X to be a regulator) f*#*g rule of rounding the CI's.”

BTW: My original question was more concerned with empirical alpha>0.05 significant without rounding. I wouldn't expect such cases to be real. Otherwise the theory behind our BE statistics is wrong.

BTW2: There is a question that bothers me, every time I think about it:
assuming BE if
   0.8 ≤ lCL and uCL ≤ 1.25 (I)
or better
   0.8 < lCL and uCL < 1.25  (II)
.
At least in formulating the bioequivalence alternative hypothesis it is always written:
   Θ1< µTR < Θ2
and the corresponding two one-sided t-statistics have to be tl < -t(1-α,df) and tu > t(1-α,df). Does this transform really to (I) for the confidence interval inclusion rule? The EMA guidance is here clear: "To be inside the acceptance interval the lower bound should be ≥ 80.00% when rounded to two decimal places and the upper bound should be ≤ 125.00% when rounded to two decimal places." But the regulatory point of view is not necessarily the scientific one as we noticed more than once.

In case of no rounding this doesn't make much difference since lCL=0.8 and uCL=1.25 (without rounding) are obtained with probability of nearly zero. But in case of rounding ...

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-07 18:29
(4120 d 03:51 ago)

@ d_labes
Posting: # 9797
Views: 11,179
 

 Flaw in the GL?

Dear Detlew,

sorry for the confusing post.

Summary of CIs of the 50331 sim’s passing the unrounded criterion:
     Unrd.lo              Unrd.hi               Rd.lo                Rd.hi
Min.   :1.03984217   Min.   :1.15101402   Min.   :1.03980000   Min.   :1.15100000
1st Qu.:1.13630237   1st Qu.:1.23050864   1st Qu.:1.13630000   1st Qu.:1.23050000
Median :1.15065573   Median :1.23972299   Median :1.15070000   Median :1.23970000
Mean   :1.15006990   Mean   :1.23640877   Mean   :1.15006972   Mean   :1.23640889
3rd Qu.:1.16470993   3rd Qu.:1.24556820   3rd Qu.:1.16470000   3rd Qu.:1.24560000
Max.   :1.22939131   Max.   :1.24999989   Max.   :1.22940000   Max.   :1.25000000

Summary of CIs of the 50503 sim’s passing the rounded criterion:
     Unrd.lo              Unrd.hi               Rd.lo                Rd.hi
Min.   :1.03984217   Min.   :1.15101402   Min.   :1.0398000   Min.   :1.15100000
1st Qu.:1.13631513   1st Qu.:1.23056103   1st Qu.:1.1363000   1st Qu.:1.23060000
Median :1.15069540   Median :1.23976572   Median :1.1507000   Median :1.23980000
Mean   :1.15011128   Mean   :1.23645515   Mean   :1.1501111   Mean   :1.23645518
3rd Qu.:1.16475001   3rd Qu.:1.24561372   3rd Qu.:1.1647500   3rd Qu.:1.24560000
Max.   :1.22939131   Max.   :1.25004974   Max.   :1.2294000   Max.   :1.25000000


❝ ❝     Unrounded.lo     Unrounded.hi  Rd.lo  Rd.hi

❝ ❝ 1.14406215516423 1.25000008857710 1.1441 1.2500

❝ ❝

❝ ❝ 1.16009942086582 1.25004974319996 1.1601 1.2500


❝ I'm not certain if I understand your numbers given. How do the above correspond to below? Numbers from cases which were judged BE if rounded and not BE if not rounded?


❝ ❝     Unrounded.lo         Unrounded.hi         Rounded.lo         Rounded.hi

❝ ❝ Min.   :1.11998223   Min.   :1.25000009   Min.   :1.12000000   Min.   :1.25

❝ ❝ 1st Qu.:1.14730961   1st Qu.:1.25001184   1st Qu.:1.14730000   1st Qu.:1.25

❝ ❝ Median :1.16346327   Median :1.25002528   Median :1.16345000   Median :1.25

❝ ❝ Mean   :1.16222013   Mean   :1.25002554   Mean   :1.16221977   Mean   :1.25

❝ ❝ 3rd Qu.:1.17608605   3rd Qu.:1.25003838   3rd Qu.:1.17610000   3rd Qu.:1.25

❝ ❝ Max.   :1.20299871   Max.   :1.25004974   Max.   :1.20300000   Max.   :1.25


The list of the the 172 studies failing the unrounded but passing the rounded criterion above were ordered by the unrounded upper CL. So the lowest was 1.2500000885771 and the highest 1.25004974319996. This matches the summary above.

❝ ❝ Mr X will tell me “Nice simulations proving the patient’s risk is not maintained.”

❝ Augmented with the reply “If and only if one uses your (assuming Mister X to be a regulator) f*#*g rule of rounding the CI's.”


I would try to use a different wording – likely after consulting our capt’n.

❝ BTW: My original question was more concerned with empirical alpha>0.05 significant without rounding. I wouldn't expect such cases to be real. Otherwise the theory behind our BE statistics is wrong.


I wouldn’t say simulations disprove theory here. The convergence is slow (see the plot for Method B). Significant results might be pure chance.

❝ BTW2: There is a question that bothers me, every time I think about it:

❝ assuming BE if

   0.8 ≤ lCL and uCL ≤ 1.25 (I)

or better

   0.8 < lCL and uCL < 1.25  (II).


Ouch, that hurts! Wellek (2003), Patterson & Jones (2006), Hauschke et al. (2007), Chow and Liu (2009):
$$\begin{matrix}
H_0:\mu_\textrm{T}-\mu_\textrm{R}\,{\color{Red}\leq}\,\theta_\textrm{L}\;\textrm{or}\;\mu_\textrm{T}\,{\color{Red}\geq}\,\theta_\textrm{U}\\
H_\textrm{a}:\theta_\textrm{L}\,{\color{Green}<}\,\mu_\textrm{T}-\mu_\textrm{R}\,{\color{Green}<}\theta_\textrm{U}
\end{matrix}$$Minority report*:$$-\theta_\textrm{A}\,{\color{Red}\leq}\,\mu_\textrm{T}-\mu_\textrm{R}\,{\color{Red}\leq}\,\,\theta_\textrm{A}$$

❝ At least in formulating the bioequivalence alternative hypothesis it is always written:

   Θ1< µTR < Θ2


Yep, based on the above.

❝ and the corresponding two one-sided t-statistics have to be tl < -t(1-α,df) and tu > t(1-α,df). Does this transform really to (I) for the confidence interval inclusion rule?


No. Transforms definitely into (II).

❝ The EMA guidance is here clear: "To be inside the acceptance interval the lower bound should be 80.00% when rounded to two decimal places and the upper bound should be 125.00% when rounded to two decimal places." But the regulatory point of view is not necessarily the scientific one as we noticed more than once.


Wonderful. You discovered a flaw in the GL! According to the model BE should not be [0.8, 1.25] (borders inclusive) but ]0.8, 1.25[ (borders exclusive).

❝ In case of no rounding this doesn't make much difference since lCL=0.8 and uCL=1.25 (without rounding) are obtained with probability of nearly zero. But in case of rounding ...


¡Fantástico!
             unrounded         rnd. (commerc.)        rnd. (R)   
         [80,125]  ]80,125[  [80,125]  ]80,125[  [80,125]  ]80,125[
 79.900                                                  
 79.995                       +                  +         
 79.999                       +                  +         
 80.000     +                  +                  +         
 80.001     +         +         +                  +         
 80.005     +         +         +         +         +         
 80.010     +         +         +         +         +         +
124.900     +         +         +         +         +         +
124.995     +         +         +                  +         
124.999     +         +         +                  +         
125.000     +                  +                  +         
125.001                       +                  +         
125.005                                         +         
125.010                                                  



  • Verbeeck R and FT Musuamba
    The Revised 2010 EMA Guideline for the Investigation of Bioequivalence for Immediate Release Oral Formulations with Systemic Action
    J Pharm Pharmaceut Sci 15/3, 376–88 (2012)
    online

P.S.: Another goodie from the FDA (see this post; downscaling the AR for NTIDs). Have a close look at this line of code:
theta=((log(1.11111))/0.1)**2;

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
d_labes
★★★

Berlin, Germany,
2013-01-08 12:44
(4119 d 09:37 ago)

@ Helmut
Posting: # 9798
Views: 11,124
 

 Flaw in the GL?

Dear Helmut,

❝ ... Transforms definitely into (II).


In contrast to you I'm not quite sure.

It is explicitly stated that way (< and not ≤) in

Hauschke, Steinijans, Pigeot
"Bioequivalence Studies in Drug Development"
Wiley, Chichester, 2007, page 90

... but I have 2 other minority reports for you (proof/evidence by authority: "Well, Lieschen Mueller says it's true, so it must be." :cool:)

Westlake, W.J.
"Symmetrical Confidence Intervals for Bioequivalence Trials"
Biometrics, 32, p 741-744 (1976)

stating the confidence interval inclusion rule explicitly with and

Diletti et.al.
"Sample size determination for bioequivalence assessment by means of confidence intervals"
Int. J. Clin. Pharm., Ther. and Tox., Vol.30, Supl. 1, p. S51-58 (192)

stating the two one-sided tests explicitly as
t1=(mT-mR-ln(Θ1))/(sD*sqrt(2/n)) t(1-α,df)
t2=(mT-mR-ln(Θ2))/(sD*sqrt(2/n)) -t(1-α,df)


Other papers state the interval inclusion rule as
I ⊂ (Θ12)
subset sign: an U rotated 90° clockwise
where I is an appropriate confidence interval. I as an amateur are not able to figure out what is meant: The meaning A⊆B, when A is called a subset of B; A can be equal to B (i.e. borders included). Or A⊂B, then A is called a proper subset of B; A cannot equal B (i.e. at least one border excluded).
That time the "Theory of sets" was dealt with I have skipped school :-D.

This is only an incomplete selection of findings which led to my uncertainness. As stated above: Using real numbers (not rounded) it will not make much a difference how we implement it, thus we can't empirical test it via simulations.
Any pro-statistician out there to enlighten this issue?

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-08 20:08
(4119 d 02:13 ago)

@ d_labes
Posting: # 9799
Views: 11,223
 

 What a mess!

Dear Detlew,

❝ It is explicitly stated that way (< and not ≤) in


Hauschke, Steinijans, Pigeot

"Bioequivalence Studies in Drug Development"

❝ Wiley, Chichester, 2007, page 90


That’s what I wrote above. See also on top of page 89. The Nulls are given including the boundaries and the alternatives excluding them.

❝ ... but I have 2 other minority reports for you (proof/evidence by authority: "Well, Lieschen Mueller says it's true, so it must be." :cool:)


:-D

Westlake, W.J.

"Symmetrical Confidence Intervals for Bioequivalence Trials"

❝ Biometrics, 32, p 741-744 (1976)


❝ stating the confidence interval inclusion rule explicitly with and


Diletti et.al.

"Sample size determination for bioequivalence assessment by means of confidence intervals"

❝ Int. J. Clin. Pharm., Ther. and Tox., Vol.30, Supl. 1, p. S51-58 (192)


❝ stating the two one-sided tests explicitly as

t1=(mT-mR-ln(Θ1))/(sD*sqrt(2/n)) t(1-α,df)

❝ t2=(mT-mR-ln(Θ2))/(sD*sqrt(2/n)) -t(1-α,df)


Yep, but before (p. S52):

H0: ln µT/µR≤ln θ1 or ln µT/µR≥ln θ2 (bioinequivalence)
H1: ln θ1<ln µT/µR<ln θ2 (bioequivalence)

Drives me nuts.

What about Mr Schuirmann (1987)…

H01: µTµRθ1
H11: µTµR>θ1

and

H02: µTµRθ1
H12: µTµR<θ1

Bioequivalent if

t1=:blahblah:t1-α(ν) and t2=:blahblah:t1-α(ν)

Continuing with

“The two one-sided tests procedure turns out to be operationally identical to the procedure of declaring equivalence only if the ordinary 1-2α confidence (not 1-α) confidence interval for µTµR is completely contained in the equivalence interval [θ1, θ2].”

Completely contained?

Kem Phillips (1990)

H0: µTµR<θL or µTµR>θU
H1: θLµTµRθU

continuing with

“H0 is rejected in favor of bioequivalence if TL and -TU equal or exceed t1-α,ν […]”


And so on and so forth in many papers…

❝ Other papers state the interval inclusion rule as

I ⊂ (Θ12)


Oh yes. I use it sometimes myself as well.

❝ That time the "Theory of sets" was dealt with I have skipped school :-D.


When I was in school from one year to the next everything was given as sets. Was fashionable for a while. Didn’t bother me too much because I’ve spent many schooldays in one of the many Viennese coffee houses anyhow.

❝ This is only an incomplete selection of findings which led to my uncertainness. As stated above: Using real numbers (not rounded) it will not make much a difference how we implement it,…


Agree. In my home-brew BE software I didn’t round at all, but tested for θL ≤ 90% CI ≤ θU. Ever since I’m using commercial software I’m in limbo. I validated Phoenix/WinNonlin with data sets from the literature (and even a very small one manually). But none of them “scratched at the edge”. The manual isn’t helpful:

If the interval (CI_Lower, CI_Upper) is contained within LowerBound and UpperBound, average bioequivalence has been shown.

Contained? Meaning or ?

❝ … thus we can't empirical test it via simulations.

Not sure what you mean here. :confused:

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
d_labes
★★★

Berlin, Germany,
2013-01-09 11:33
(4118 d 10:48 ago)

@ Helmut
Posting: # 9801
Views: 11,008
 

 What a mess!

Dear Helmut,

❝ In my home-brew BE software I didn’t round at all, but tested for θL ≤ 90% CI ≤ θU.


Me too. From our sponsors perspective it's the better choice and if rounding comes into play it looks much better ;-). In that sense the R rounding is also a good choice.

❝ ❝ … thus we can't empirical test it via simulations.

❝ Not sure what you mean here. :confused:


I meant that simulations with θL ≤ 90% CI ≤ θU do not give substantial different results compared to θL < 90% CI < θU. Thus we can't choose that alternative which is closer to the analytical power calculation results (of course via PowerTOST :cool:).

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-09 16:18
(4118 d 06:03 ago)

@ d_labes
Posting: # 9802
Views: 10,989
 

 What a mess!

Dear Detlew,

❝ ❝ ❝ … thus we can't empirical test it via simulations.

❝ ❝ Not sure what you mean here. :confused:


❝ I meant that simulations with θL ≤ 90% CI ≤ θU do not give substantial different results compared to θL < 90% CI < θU. Thus we can't choose that alternative which is closer to the analytical power calculation results…


Ah, now I understand! Theoretically (!) it would be possible if one goes with an R-package allowing for high numeric precision (see [msg]this post[/msg]) or Maxima and run a zillion of sim’s. Would need a supercomputer in the backyard.

❝ … (of course via PowerTOST :cool:).


What else? :-D
In my future sim’s of alpha (rounded CI) I will go for a ratio 0.80 instead of 1.25 since all three algos we have discussed give the same results there. Nevertheless, more studies than the 5% expected will pass making a significant result difficult to interpret.

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
ElMaestro
★★★

Denmark,
2013-01-02 17:12
(4125 d 05:09 ago)

@ Helmut
Posting: # 9778
Views: 11,458
 

 Rounding

Hi HS,

❝ @ElMaestro: Do you round in C?


Yes, I gave it some thought in C. Perhaps a little oddly, but in the C standard C will round down for integers (i.e. if you convert 125.8 to an integer the standard will be to tell you the result is 125). For recent sims I therefore need to make sure that the compiler does not convert to integers before the comparison with 125 or 80 is done. This is done e.g. by comparison with a true double precision figure like 80.00 rather than 80.

Pass or fail!
ElMaestro
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-02 18:04
(4125 d 04:17 ago)

@ ElMaestro
Posting: # 9779
Views: 11,554
 

 Abandon rounding

Hi ElMaestro,

❝ Perhaps a little oddly, but in the C standard C will round down for integers


I see. Another hint that C is a child of Fortran (also rounding down).

❝ […] This is done e.g. by comparison with a true double precision figure like 80.00 rather than 80.


Yep. In my future sim’s I will abandon rounding at all. Edit: See above. In my sim’s I used the ratios (not percentages) rounded to 4 decimals.
round(x.xxxxx,4) works – the problem comes with round(xxx.xxx,2).

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
yjlee168
★★★
avatar
Homepage
Kaohsiung, Taiwan,
2013-01-06 00:15
(4121 d 22:06 ago)

@ Helmut
Posting: # 9790
Views: 11,332
 

 Rounding

Dear Helmut,

❝ How does your software round? Mine:

Excel 2000:       round(125.005, 2) → 125.01

OO Calc:          round(125.005, 2) → 125.01

Gnumeric 1.10.16: round(125.005, 2) → 125.01

WinNonlin 5.3:    round(125.005, 2) → 125.01

Phoenix 6.3:      round(125.005, 2) → 125.01

JavaScript:       Math.round(125.005*100)/100 → 125.01

PHP:              round(125.005, 2) → 125.01

R 2.15.2:         round(125.005, 2) → 125.00


Based on ICE 60559's rounding off a '5' standard (go to the even digit), "R 2.15.2: round(125.005, 2) ⇒ 125.00" is correct. Zero is considered as an even digit.

All the best,
-- Yung-jin Lee
bear v2.9.1:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan https://www.pkpd168.com/bear
Download link (updated) -> here
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-06 04:29
(4121 d 17:52 ago)

@ yjlee168
Posting: # 9792
Views: 11,200
 

 Rounding

Hi Yung-jin,

❝ Based on ICE 60559's rounding off a '5' standard (go to the even digit), "R 2.15.2: round(125.005, 2) ⇒ 125.00" is correct. Zero is considered as an even digit.


I know – and the heated discussions on the R-Help list as well. :-D
As Detlew mentioned above I don’t expect regulators to be familiar with
round(c(0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5), 0)
[1]  0  2  2  4  4  6  6  8  8 10
*

More (and an answer to your PM) tomorrow.


  • I call that bias towards even.

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
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-01-06 16:34
(4121 d 05:47 ago)

@ yjlee168
Posting: # 9793
Views: 11,243
 

 Rounding

Hi Yung-jin,

continuing our personal communication. THX for reminding me on the rule your professor in physical chemistry taught you. How could I forget this goodie?
  1. if the number next to the required digit ≤4, then drop it: 125.003 ⇒ 125.00
  2. if the number next to the required digit ≥6, then add 1 to the required digit: 125.008 ⇒ 125.01
  3. if the number next to the required digit =5, then
    1. if the required digit is odd, then add 1 to the required digit: 125.015 ⇒ 125.02
    2. if the required digit is even, then drop it: 125.005 ⇒ 125.00
x = 124.990–125.010, step 0.0005; y = rounded to two decimal figures. Dashed line: y = 125.005

(1) Commercial rounding:
[image]

(2) R & Maxima:
[image]

(3) Chem. rounding:
[image]


Based on the regression I would prefer (3). But the down-rounding close to 125.005 extends even further up than in R & Maxima:
            (1)    (2)    (3)
124.9950  125.00 125.00 125.00
← rule 3.1
125.0045  125.00 125.00 125.00 ← rule 1
125.0050  125.01 125.00 125.00 ← rule 3.2
125.0055  125.01 125.01 125.00 ← rule 3.2
125.0059  125.01 125.01 125.00 ← rule 3.2
125.0060  125.01 125.01 125.01 ← rule 2


Edit: It’s clear that we are loosing information in rounding. No big deal if we don’t introduce bias. Nice that R & Maxima use ‘rounding half to even’ which is overall (i.e., [–∞, 0, +∞]) less biased than ‘rounding half away from zero’. However bias exists – just a different one.
In our case we have positive numbers only. ‘Best’ algo?

BTW, is disturbed me somewhat that most replies at R-Help were like “R complies with the standard. Full stop.”

As soon as we abandon our own reason, and are content
to rely upon authority, there is no end to our troubles.
  Bertrand Russell

A central lesson of science is that to understand complex issues
(or even simple ones), we must try to free our minds of dogma and
to guarantee the freedom to publish, to contradict, and to experiment.
Arguments from authority are unacceptable.
  Carl Sagan

Anyone who conducts an argument by appealing to authority
is not using his intelligence;
he is just using his memory.
  Leonardo da Vinci


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
yjlee168
★★★
avatar
Homepage
Kaohsiung, Taiwan,
2013-01-07 00:38
(4120 d 21:43 ago)

@ Helmut
Posting: # 9794
Views: 11,264
 

 Rounding

Dear Helmut,
  1. Firstly, I like to thank you for giving me the chance to look at rounding issue, although I don't think that I am a mathematician to deal with such a tough question. For me, rounding rule is just like a guideline to follow with. I will not take it as scientific issue, but just a rule or a standard. Otherwise, why do people make such a standard (IEC 60559)? Just like BE criteria is set as 90%CI of 80.00% ~ 120.00%. Fortunately, after discussion I find that the rounding rule I use is the same as IEC 60559 standard. So I will put IEC 60559 standard into my SOP of data analysis later.
  2. So far, I don't think that R completely complies IEC 60559 standard in its rounding function (as your demonstration) under Windows (my computer OS). In R online help, it says that the rounding function may vary with different computer OS. Fortunately, in your case (round(125.005, digits=2), it complies.
  3. I agree with that rounding will loose information. But sometimes it may also introduce bias too. Arbitrarily, we call it 'rounding error.' Because it can be difficult to estimate the rounding error, so we live with it. It will not introduce bias only when we take the final number to round off and present it. If this is the case, we don't have to worry about the bias.
  4. Finally, I absolutely agree with you that sometimes R drives me nuts too.

All the best,
-- Yung-jin Lee
bear v2.9.1:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan https://www.pkpd168.com/bear
Download link (updated) -> here
UA Flag
Activity
 Admin contact
22,988 posts in 4,825 threads, 1,657 registered users;
92 visitors (0 registered, 92 guests [including 7 identified bots]).
Forum time: 23:21 CEST (Europe/Vienna)

The only way to comprehend what mathematicians mean by Infinity
is to contemplate the extent of human stupidity.    Voltaire

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