# NCA for single oral dose

**URL:** <https://discourse.pumas.ai/t/nca-for-single-oral-dose/307>\
**Category:** NCA\
**Created:** [March 25, 2020, 7:59pm UTC](https://discourse.pumas.ai/t/nca-for-single-oral-dose/307 "2020-03-25T19:59:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawangpt700](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/pawangpt700/32/387_2.png) [@pawangpt700](https://discourse.pumas.ai/u/pawangpt700)\
**Post date:** [March 25, 2020, 7:59pm UTC](https://discourse.pumas.ai/t/nca-for-single-oral-dose/307/1 "2020-03-25T19:59:59Z")

</div>

Hello,

I am trying to do NCA of a single oral dose dataset. The code is as follows,

```
using Pumas
using CSV
using Plots
using DataFrames
using DataFramesMeta
using Distributions
using Random
using ExcelReaders

#################Data importing###########################
data_PK = CSV.read("PK_data.csv", datarow=3)
data_PK[!, :route] .= "ev"
show(first(data_PK,6))

############################################################
######## Non-Compartmental Analysis if the PK data #########
############################################################

#define units
timeu = u"hr"
concu = u"mg/L"
amtu = u"mg"

# data mapping
data_PK_pop = read_nca(data_PK,
                        id = :ID,
                        amt = :AMT,
                        time = :NOMTAD,
                        conc = :DV,
                        route = :route)

pk_lambdaz = NCA.lambdaz(data_PK_pop, threshold = 3) #terminal rate constant
pk_auc = NCA.auc(data_PK_pop, auctype=:inf, method =:linuplogdown)
pk_nca_results = NCAReport(data_PK_pop)
pk_nca_report = NCA.to_dataframe(pk_nca_results)
CSV.write("NCA Report.csv", pk_nca_report)

```

I am getting an error as follows,

Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration  
[ Info: ID 20 errored: lambdaz calculation needs at least three data points between Cmax and the last positive concentration

I checked the observed concentrations for ID 20, and for it, the Cmax occurred at last but 3rd time point. As a result, the parameters for ID 20 are not estimated. Any suggestions for dealing with this problem?

---

<div class="post-metadata">

**Author:** ![vijay](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/vijay/32/96_2.png) [@vijay](https://discourse.pumas.ai/u/vijay)\
**Post date:** [March 25, 2020, 8:47pm UTC](https://discourse.pumas.ai/t/nca-for-single-oral-dose/307/2 "2020-03-25T20:47:36Z")

</div>

@pawangpt700 welcome to the community.

As the message suggests, you cannot estimate a lambdaz with just 2 datapoints. The only way to move forward is to drop that subject from your analysis providing a justification of why you are doing it

---

<div class="post-metadata">

**Author:** ![pawangpt700](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/pawangpt700/32/387_2.png) [@pawangpt700](https://discourse.pumas.ai/u/pawangpt700)\
**Post date:** [March 25, 2020, 8:56pm UTC](https://discourse.pumas.ai/t/nca-for-single-oral-dose/307/3 "2020-03-25T20:56:22Z")

</div>

Thank you, @vijay!..
