Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with aucint.inf.obs and missing data #104

Closed
kirstenbergmann opened this issue Jul 9, 2019 · 4 comments
Closed

problem with aucint.inf.obs and missing data #104

kirstenbergmann opened this issue Jul 9, 2019 · 4 comments
Labels

Comments

@kirstenbergmann
Copy link

I have a dataset with missing concentration values (NA values) and get an error when trying to get AUCint (using aucint.inf.obs). The example runs fine if I replace the NA value with a number. The example also runs fine if I only request AUClast. I did try to include the option conc.na="drop" but this doesnt seem to solve the problem.

library('PKNCA')
conc <- data.frame(time=c(0,0.2833,0.5,1,2,3,4,5,6.0167,12,23.917),
            conc=c(1378.39,NA,1671.20,1553.99,1650.02,2044.83,1883.92,2045.73,1528.76,1701.77,1219.65),
                   SUBJID=rep(1,11))
dose <- data.frame(time=0,dose=5000,SUBJID=1)
my.conc <- PKNCAconc(conc,conc~time|SUBJID)
my.dose <- PKNCAdose(dose,dose~time|SUBJID)

my.interval <- data.frame(start=0,
                          end=24,
                          auclast=TRUE,
                          aucint.inf.obs=TRUE)


my.data <- PKNCAdata(my.conc, my.dose,intervals=my.interval)
my.results <- pk.nca(my.data)
#> Warning in pk.calc.aucint(conc = conc, time = time, start = start, end =
#> end, : Some interpolated/extrapolated concentration values are missing Time
#> points with missing data are: 0.2833
@billdenney
Copy link
Owner

Hi @kirstenbergmann,

It's just a typo in the interval column name for aucinf.obs. Replace your my.interval with the code below, and it will work.

my.interval <- data.frame(start=0,
                          end=24,
                          auclast=TRUE,
                          aucinf.obs=TRUE)

@kirstenbergmann
Copy link
Author

kirstenbergmann commented Jul 10, 2019

Hi Bill

I dont want to calculate AUCinf but AUCtau, which in this case is not the same as AUClast as the last measurement is not at 24hours. I think aucint.inf.obs is what I want to use to get AUCtau. Below is an example without NA in the dataset:

library('PKNCA')
conc <- data.frame(time=c(0,0.2833,0.5,1,2,3,4,5,6.0167,12,23.917),
                   conc=c(1378.39,1501.23,1671.20,1553.99,1650.02,2044.83,1883.92,2045.73,1528.76,1701.77,1219.65),
                   SUBJID=rep(1,11))
dose <- data.frame(time=0,dose=5000,SUBJID=1)
my.conc <- PKNCAconc(conc,conc~time|SUBJID)
my.dose <- PKNCAdose(dose,dose~time|SUBJID)

my.interval <- data.frame(start=0,
                          end=24,
                          auclast=TRUE,
                          aucint.inf.obs=TRUE,
                          aucinf.obs=TRUE)

my.data <- PKNCAdata(my.conc, my.dose,intervals=my.interval)
my.results <- pk.nca(my.data)
as.data.frame(my.results)
#>    start end SUBJID            PPTESTCD      PPORRES exclude
#> 1      0  24      1             auclast 3.765216e+04    <NA>
#> 2      0  24      1                tmax 5.000000e+00    <NA>
#> 3      0  24      1               tlast 2.391700e+01    <NA>
#> 4      0  24      1           clast.obs 1.219650e+03    <NA>
#> 5      0  24      1            lambda.z 1.479558e-02    <NA>
#> 6      0  24      1           r.squared 6.287049e-01    <NA>
#> 7      0  24      1       adj.r.squared 2.574098e-01    <NA>
#> 8      0  24      1 lambda.z.time.first 6.016700e+00    <NA>
#> 9      0  24      1   lambda.z.n.points 3.000000e+00    <NA>
#> 10     0  24      1          clast.pred 1.268509e+03    <NA>
#> 11     0  24      1           half.life 4.684826e+01    <NA>
#> 12     0  24      1          span.ratio 3.820910e-01    <NA>
#> 13     0  24      1          aucinf.obs 1.200856e+05    <NA>
#> 14     0  24      1      aucint.inf.obs 3.775333e+04    <NA>

@billdenney
Copy link
Owner

@kirstenbergmann, sorry for misunderstanding the question. That is definitely a bug then!

@billdenney
Copy link
Owner

I just fixed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants