pjs
★    

India,
2017-05-21 17:57
(2503 d 06:17 ago)

Posting: # 17379
Views: 8,292
 

 AUC calculation in bear [🇷 for BE/BA]

Hi all,

I have just started using bear. Thanks to the developers for this wonderful freeware.

Following is the AUC calculation done in bear for one subject data.

 subj  time    conc AUC(0-t) AUMC(0-t)
    1  0.00   0.000    0.000     0.000
    1  1.00   0.000    0.000     0.000
    1  1.50   0.000    0.000     0.000
    1  2.00   0.000    0.000     0.000
    1  2.50   0.000    0.000     0.000
    1  3.00   0.000    0.000     0.000
    1  3.50   0.000    0.000     0.000
    1  4.00   1.518    0.380     1.518
    1  4.33   5.027    1.459     6.111
    1  4.67  12.700    4.473    19.894
    1  5.00  22.210   10.233    48.004
    1  5.33  18.013   16.846    82.120
    1  5.67  22.332   23.704   119.967
    1  6.00  30.500   32.422   171.055
    1  6.33  24.290   41.423   226.493
    1  6.67  31.676   50.937   288.549
    1  7.00  32.647   61.551   361.117
    1  7.50  45.512   81.091   503.584
    1  8.00  95.827  116.425   780.573
    1 10.00 120.261  332.513  2749.799
    1 12.00  89.598  540.870  5031.520
    1 16.00  41.572  791.036  8470.430
    1 24.00  24.576 1049.699 13553.463
    1 36.00   9.237 1237.802 19015.333
    1 48.00   4.897 1319.870 22410.463
    1 72.00   1.976 1397.115 26906.872
    1 96.00   1.287 1435.682 30113.526


Now if i do manual calculation of AUC by trapezoid rule by formula, AUC is coming to 1478.681 instead of 1435.682 by bear.

Can anyone pls explain the reason for this difference.

Regards
Pjs

Edit: BBcoded; see also this post #6. [Helmut]
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2017-05-21 19:32
(2503 d 04:42 ago)

@ pjs
Posting: # 17380
Views: 7,748
 

 lin-up/log-down is bear’s default

Dear Pjs,

❝ […] this wonderful freeware


bear = free software (open source) ≠ freeware. :-D

❝ […] if i do manual calculation of AUC by trapezoid rule by formula, AUC is coming to 1478.681 instead of 1435.682 by bear.


Note that the lin-up/log-down trapezoidal method is the default in bear – and for good reasons (IMHO, the linear rule should abandoned since it overestimates the AUC in the distribution/elimination phase). I got:

 time    conc     bear   incr/equal  linear   lin/log
 0.00    0.000     0.000    yes      0.000      0.000
 1.00    0.000     0.000    yes      0.000      0.000
 1.50    0.000     0.000    yes      0.000      0.000
 2.00    0.000     0.000    yes      0.000      0.000
 2.50    0.000     0.000    yes      0.000      0.000
 3.00    0.000     0.000    yes      0.000      0.000
 3.50    0.000     0.000    yes      0.000      0.000
 4.00    1.518     0.380    yes      0.380      0.380
 4.33    5.027     1.459    yes      1.459      1.459
 4.67   12.700     4.473    yes      4.473      4.473
 5.00   22.210    10.233    no      10.233     10.088
 5.33   18.013    16.846    yes     16.870     16.725
 5.67   22.332    23.704    yes     23.729     23.583
 6.00   30.500    32.422    no      32.446     32.231
 6.33   24.290    41.423    yes     41.486     41.271
 6.67   31.676    50.937    yes     51.000     50.785
 7.00   32.647    61.551    yes     61.614     61.398
 7.50   45.512    81.091    yes     81.154     80.938
 8.00   95.827   116.425    yes    116.488    116.273
10.00  120.261   332.513    no     332.576    331.437
12.00   89.598   540.870    no     542.435    539.794
16.00   41.572   791.036    no     804.775    789.960
24.00   24.576  1049.699    no    1069.367   1048.623
36.00    9.237  1237.802    no    1272.245   1236.725
48.00    4.897  1319.870    no    1357.049   1318.793
72.00    1.976  1397.115    no    1439.525   1396.039
96.00    1.287  1435.682    no    1478.681   1434.606


Lin-up/log-down trapezoidal method:
If concentrations are increasing or equal in the interval [1, 2] use the linear trapezoidal, i.e.,

AUC1–2 = 0.5(t2–t1)(C2+C1)

If concentrations are decreasing in the interval [1, 2] use the log trapezoidal, i.e.,

AUC1–2 = (t2–t1)(C2–C1)∕log(C2∕C1)


1435.682 ≠ 1434.606. Close, but… Is it possible that in your original data set times and/or concentrations are given with more significant digits than you posted here? Please check.

If you have to use the linear trapezoidal method (stupid SAP, SOP, boss), see this post and change the Setting for trapezoidal AUC from 0 to 1.

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

India,
2017-05-21 21:08
(2503 d 03:06 ago)

@ Helmut
Posting: # 17381
Views: 7,346
 

 lin-up/log-down any regulatory recommendation?

Dear Helmut,

Thanks for the explanation :-). Is there any regulatory requirement for the use of linup-logdown method.

As u explained there could be more bias in the AUC estimation in case of missing samples.

Do this needs to be defined in the Protocol?

This could become crucial incase of borderline study results for AUC.

Regards
pjs
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2017-05-21 21:14
(2503 d 02:59 ago)

@ pjs
Posting: # 17382
Views: 7,348
 

 lin-up/log-down any regulatory recommendation?

Hi Pjs,

❝ Thanks for the explanation :-).


Would you mind answer my question from above? Did you use more significant digits?

❝ Is there any regulatory requirement for the use of linup-logdown method.


No. Was recommended in the previous version of the WHO’s GL.

❝ Do this needs to be defined in the Protocol?


Exactly. Go ahead and update your SOP.

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

India,
2017-05-21 21:33
(2503 d 02:40 ago)

@ Helmut
Posting: # 17383
Views: 7,280
 

 lin-up/log-down any regulatory recommendation?

Hi Helmut

❝ Would you mind answer my question from above? Did you use more significant digits?


No similar digits were used for the data incorporation in bear.

❝ ❝ Is there any regulatory requirement for the use of linup-logdown method.

❝ No. Was recommended in the previous version of the WHO’s GL.


Ok Thanks.

Regards
Pjs
yjlee168
★★★
avatar
Homepage
Kaohsiung, Taiwan,
2017-05-21 22:08
(2503 d 02:05 ago)

@ Helmut
Posting: # 17384
Views: 7,453
 

 lin-up/log-down is bear’s default

Dear Helmut,

Thanks for your help. :ok:

The following step can be done also simply from GUI as shown in the picture.

❝ If you have to use the linear trapezoidal method (stupid SAP, SOP, boss), see this post and change the Setting for trapezoidal AUC from 0 to 1.


[image]

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

Belarus,
2017-05-25 14:52
(2499 d 09:21 ago)

@ yjlee168
Posting: # 17415
Views: 7,176
 

 lin-up/log-down is bear’s default

Dear yjlee168
:confused: Do I understand correctly that it is necessary to set zero when entering data into a bear if there are concentrations below the lower detection level at the end of sampling? :-|
Regards
yjlee168
★★★
avatar
Homepage
Kaohsiung, Taiwan,
2017-05-25 16:38
(2499 d 07:36 ago)

@ Yura
Posting: # 17416
Views: 7,224
 

 zero (0), missing (NA), or BLLOQ (0 or NA) in bear (II)

Dear Yura,

You can enter BBLOQ as 'NA' or zero depending on your SOP. Please have a look at this.


Edit: Changed to internal link; see also this post #7. [Helmut]

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

Belarus,
2017-05-25 17:17
(2499 d 06:56 ago)

@ yjlee168
Posting: # 17417
Views: 7,123
 

 zero (0), missing (NA), or BLLOQ (0 or NA) in bear (II)

Dear yjlee168
:-) Thank you
Astea
★★  

Russia,
2017-05-22 04:12
(2502 d 20:02 ago)

@ Helmut
Posting: # 17385
Views: 7,388
 

 lin-up/log-down is bear’s default

Dear Helmut!

Please check the data you've posted in the column "lin/log". Accidently you've summed a previous to the "down" number instead: pay attention, every "no" follows the moment previous to that of falling the concentration (like 22.210 to 18.013). The data in the "bear" column is correct. It also coincides with that of the "linear up log down" method in WinNonLin (1435.6823). For "linear trapezoidal linear interpolation" I've got 1478.6813 in WinNonLin and 1478.7 in bear.

"Being in minority, even a minority of one, did not make you mad"
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2017-05-22 15:19
(2502 d 08:55 ago)

@ Astea
Posting: # 17386
Views: 7,473
 

 Never use Excel

Dear Astea,

❝ Please check the data you've posted in the column "lin/log".


THX, I stand corrected! I should have observed Martin’s advice:

never never never never use excel for any statistical calculations


Plain R

time    <- c(0.00, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50, 4.00, 4.33,
             4.67, 5.00, 5.33, 5.67, 6.00, 6.33, 6.67, 7.00, 7.50,
             8.00, 10.00, 12.00, 16.00, 24.00, 36.00, 48.00, 72.00, 96.00)
conc    <- c(0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 1.518, 5.027,
             12.700, 22.210, 18.013, 22.332, 30.500, 24.290, 31.676, 32.647,
             45.512, 95.827, 120.261, 89.598, 41.572, 24.576, 9.237, 4.897,
             1.976, 1.287)
data    <- data.frame(time, conc, lin=0, linlog=0)
delta.t <- diff(data$time)
delta.c <- diff(data$conc)
for (j in seq_along(delta.t)) {
  # linear trapezoidal method
  data$lin[j] <- 0.5*delta.t[j]*sum(data$conc[j+1], data$conc[j])
  # lin-up/log-down trapezoidal method
  if (delta.c[j] < 0) { # decreasing         : log trapezoidal method
    data$linlog[j] <- delta.t[j]*delta.c[j]/log(data$conc[j+1]/data$conc[j])
  } else {              # increasing or equal: linear trapezoidal method
    data$linlog[j] <- data$lin[j]
  }
}
data$lin    <- cumsum(data$lin)
data$linlog <- cumsum(data$linlog)
print(round(data, 4), row.names=FALSE)

gives

  time    conc       lin    linlog
  0.00   0.000    0.0000    0.0000
  1.00   0.000    0.0000    0.0000
  1.50   0.000    0.0000    0.0000
  2.00   0.000    0.0000    0.0000
  2.50   0.000    0.0000    0.0000
  3.00   0.000    0.0000    0.0000
  3.50   0.000    0.0000    0.0000
  4.00   1.518    0.3795    0.3795
  4.33   5.027    1.4594    1.4594
  4.67  12.700    4.4730    4.4730
  5.00  22.210   10.2332   10.2332
  5.33  18.013   16.8700   16.8458
  5.67  22.332   23.7286   23.7045
  6.00  30.500   32.4459   32.4217
  6.33  24.290   41.4862   41.4232
  6.67  31.676   51.0005   50.9375
  7.00  32.647   61.6138   61.5508
  7.50  45.512   81.1535   81.0905
  8.00  95.827  116.4883  116.4253
 10.00 120.261  332.5763  332.5133
 12.00  89.598  542.4353  540.8702
 16.00  41.572  804.7753  791.0362
 24.00  24.576 1069.3673 1049.6994
 36.00   9.237 1272.2453 1237.8016
 48.00   4.897 1357.0493 1319.8698
 72.00   1.976 1439.5253 1397.1153
 96.00   1.287 1478.6813 1435.6823
                   [image]        [image]

Sorry for the confusion caused.

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
UA Flag
Activity
 Admin contact
22,957 posts in 4,819 threads, 1,636 registered users;
74 visitors (0 registered, 74 guests [including 9 identified bots]).
Forum time: 23:14 CET (Europe/Vienna)

Nothing shows a lack of mathematical education more
than an overly precise calculation.    Carl Friedrich Gauß

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