Identifying points used in half-life calculation #386
-
|
Howdy in the example below there are two subjects. For one the data to calculate half-life is specified and for the second PKNCA is figuring it out. Is there a way to extract from the result object which points were actually used for NCA calculations? library(PKNCA)
# Perform calculations for subject 1, only
data_conc <- as.data.frame(datasets::Theoph)[datasets::Theoph$Subject %in% c(1, 2), ]
# Keep all points
conc_obj <-
PKNCAconc(
data_conc,
conc~Time|Subject
)
# Only calculate half-life and parameters required for half-life
current_intervals <- data.frame(start=0, end=Inf, half.life=TRUE)
data_obj <- PKNCAdata(conc_obj, intervals=current_intervals)
result_obj <- pk.nca(data_obj)
data_conc$include_hl <- c(data_conc$Time > 3 & data_conc$Subject == 1)
data_conc$include_hl[ !(data_conc$include_hl) ] = NA
#data_conc$include_hl = FALSE
# Drop one point
conc_obj_include <-
PKNCAconc(
data_conc,
conc~Time|Subject,
include_half.life="include_hl")
data_obj_include <- PKNCAdata(conc_obj_include, intervals=current_intervals)
# Perform the calculations
result_obj_include <- pk.nca(data_obj_include) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
There isn't a way to do it directly. I opened #387 so that there can be a way. |
Beta Was this translation helpful? Give feedback.
-
|
For anyone seeing this, #387 has been closed and the function |
Beta Was this translation helpful? Give feedback.
For anyone seeing this, #387 has been closed and the function
get_halflife_pointsis already available in the package to do this. I guess this discussion could be potentially closed