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
Comments
Hi @kirstenbergmann, It's just a typo in the interval column name for my.interval <- data.frame(start=0,
end=24,
auclast=TRUE,
aucinf.obs=TRUE) |
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> |
@kirstenbergmann, sorry for misunderstanding the question. That is definitely a bug then! |
I just fixed this. |
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.
The text was updated successfully, but these errors were encountered: