# AUC bug with interval

**URL:** <https://discourse.pumas.ai/t/auc-bug-with-interval/990>\
**Category:** Pumas issues\
**Created:** [March 10, 2024, 3:26am UTC](https://discourse.pumas.ai/t/auc-bug-with-interval/990 "2024-03-10T03:26:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![donaldlee3](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/donaldlee3/32/165_2.png) [@donaldlee3](https://discourse.pumas.ai/u/donaldlee3)\
**Post date:** [March 10, 2024, 8:50pm UTC](https://discourse.pumas.ai/t/auc-bug-with-interval/990/3 "2024-03-10T20:50:13Z")

</div>

Hi @vijay,

I’ve identified the source of the problem. I have multiple dose data and group by occasion, as opposed to using `ii`. I still give the `read_NCA` `time = :time` as opposed to `time = :tad`. It appears that the auc function with a time interval is calculating `tad` itself for all the occasions, which is resulting in numerical/decimal issues. For example, my last `tad` should be 27.9999, but if I manually create my own `tad` column, and give `time = :tad` to `read_NCA`, I will get `missing` from the auc calculation on a time interval, due to the last time being 27.999899999999997.

I have fixed this issue by correcting the numerical issues:  
`df.tad .= ifelse.(df.tad .> 27, 27.9999, df1.tad)`

It would be great if there were a way for the user to not have to deal with these numerical issues.

---

_[View the full topic](https://discourse.pumas.ai/t/auc-bug-with-interval/990)._
