Question : PKNCA.options specific to certain profiles #397
-
|
Hi! I'm looking into the PKNCA.options function as part of working on issue #148 of aNCA, and what we would ideally want is the option to change the PKNCA.options parameters, most specifically the allow.tmax.in.half.life , but only for specific profiles. For example if the half life calculation is manually inputted, we would want the tmax.in.half.life to be TRUE, but in all other cases we want it to be FALSE. Currently I cannot see a way to customise this for each profile, but maybe this is something that can be implemented? similar to the way that the intervals can be customised per profile as well? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
If the half-life is manually specified with I hesitate to make the options differ by interval because they are intended to be methodology relating the the entire analysis rather than per-interval selections. (When I'm writing reports, I use the options as part of automatic report generation in the methods section. If options were per-interval, then it would be very difficult to do that.) See the example below where library(PKNCA)
#>
#> Attaching package: 'PKNCA'
#> The following object is masked from 'package:stats':
#>
#> filter
d_conc <- data.frame(conc = c(0, 2^(0:-4)), time = 0:5, hl_include = c(FALSE, rep(TRUE, 5)))
o_conc <- PKNCAconc(d_conc, conc~time)
o_data <- PKNCAdata(o_conc, intervals = data.frame(start = 0, end = Inf, half.life = TRUE))
o_nca <- pk.nca(o_data)
#> No dose information provided, calculations requiring dose will return NA.
as.data.frame(o_nca)
#> # A tibble: 10 × 5
#> start end PPTESTCD PPORRES exclude
#> <dbl> <dbl> <chr> <dbl> <chr>
#> 1 0 Inf tmax 1 <NA>
#> 2 0 Inf tlast 5 <NA>
#> 3 0 Inf lambda.z 0.693 <NA>
#> 4 0 Inf r.squared 1 <NA>
#> 5 0 Inf adj.r.squared 1 <NA>
#> 6 0 Inf lambda.z.time.first 2 <NA>
#> 7 0 Inf lambda.z.n.points 4 <NA>
#> 8 0 Inf clast.pred 0.0625 <NA>
#> 9 0 Inf half.life 1 <NA>
#> 10 0 Inf span.ratio 3 <NA>
o_conc_incl <- PKNCAconc(d_conc, conc~time, include_half.life = "hl_include")
o_data_incl <- PKNCAdata(o_conc_incl, intervals = data.frame(start = 0, end = Inf, half.life = TRUE))
o_nca_incl <- pk.nca(o_data_incl)
#> No dose information provided, calculations requiring dose will return NA.
as.data.frame(o_nca_incl)
#> # A tibble: 10 × 5
#> start end PPTESTCD PPORRES exclude
#> <dbl> <dbl> <chr> <dbl> <chr>
#> 1 0 Inf tmax 1 <NA>
#> 2 0 Inf tlast 5 <NA>
#> 3 0 Inf lambda.z 0.693 <NA>
#> 4 0 Inf r.squared 1 <NA>
#> 5 0 Inf adj.r.squared 1 <NA>
#> 6 0 Inf lambda.z.time.first 1 <NA>
#> 7 0 Inf lambda.z.n.points 5 <NA>
#> 8 0 Inf clast.pred 0.0625 <NA>
#> 9 0 Inf half.life 1 <NA>
#> 10 0 Inf span.ratio 4 <NA>Created on 2025-02-24 with reprex v2.1.1 |
Beta Was this translation helpful? Give feedback.
If the half-life is manually specified with
include_half.life, then the option excludingtmaxis ignored because the user has manually chosen the points. So, I think that what you're requesting for the effect exists now (while the specific request about different options per interval does not). Does this cover your use case and if not can you please clarify the use case more (since I think that this does cover the use case)?I hesitate to make the options differ by interval because they are intended to be methodology relating the the entire analysis rather than per-interval selections. (When I'm writing reports, I use the options as part of automatic report generation in the methods secti…