NCA returns missing AUC for AUClast

Hi, when calculating AUC in a time interval, I am getting a message that the slope cannot be calculated and the AUC output is missing. I wanted to ask if this behavior is expected where there is no need to calculate the terminal slope. Please note that the LLQ is 0.04 units and I want to set the BLQ to 0 when calculating NCA parameters.

Input:

a = DataFrame(
    id = "1", 
    amt = vcat(10., fill(0, 10)), 
    evid = vcat(1, fill(0, 10)), route = "ev",
    time = [0., 3.0, 5.0, 7.0, 10.,14.,17.,21.,23.,25.,28.],
    dv = [missing, 5.0, 3.0, 0.07, 0.09, 0.048, 0.06, 0.08, 0.083, 0.027, 0.022]
)
a_ncaobj = read_nca(a, observations = Symbol("dv"), concblq = 0, llq = 0.04)
NCA.auc(a_ncaobj; interval = (7,28), auctype=:last)

Output:

[ Info: ID 1 errored: the estimated slope is not negative, got 0.06330922513744856
1×2 DataFrame
 Row │ id      auc7_28
     │ String  Missing
─────┼─────────────────
   1 │ 1       missing

hi @Rahulub3r - since you set the concblq to a scalar value of 0, you are replacing 0.027 and 0.022 with 0. So, the time points 25 and 28 are essentially BLQ where you are requesting the value to be zero. Now, you are requesting the interval auc between 7 and 28 (where 28 is BLQ and is technically zero). I agree that it should not give missing, but essentially what you really wanted was this below?

julia> NCA.auc(a_ncaobj; interval = (7,23))
1×2 DataFrame
 Row │ id      auc7_23
     │ String  Float64
─────┼─────────────────
   1 │ 1         1.121

Right?

No, I want the function to calculate AUC7-25 by setting the concentration at 25 to 0. I am able to make it work by setting concblq to a small non-zero value in read_nca but that’s not ideal because the value I set is arbitrary. Hope this is clear

julia> a_ncaobj = read_nca(a, observations = Symbol("dv"), concblq = 0.0001, llq = 0.04)
NCAPopulation (1 subjects):
  Number of missing observations: 1
  Number of blq observations: 2

julia> NCA.auc(a_ncaobj; interval = (7,23), auctype=:last)
1×2 DataFrame
 Row │ id      auc7_23
     │ String  Float64
─────┼─────────────────
   1 │ 1         1.121

julia> NCA.auc(a_ncaobj; interval = (7,28), auctype=:last)
1×2 DataFrame
 Row │ id      auc7_28
     │ String  Float64
─────┼─────────────────
   1 │ 1        1.2044

# What I want:
julia> NCA.auc(a_ncaobj; interval = (7,25), auctype=:last)
1×2 DataFrame
 Row │ id      auc7_25
     │ String  Float64
─────┼─────────────────
   1 │ 1        1.2041