Evaluate TK statistics from a fitted model by comparing to NCA results
# S3 method for pk
eval_tkstats(
obj,
newdata = NULL,
model = "winning",
method = NULL,
tk_group = NULL,
exclude = TRUE,
dose_norm = FALSE,
finite_only = FALSE,
suppress.messages = NULL,
...
)
A `data.frame` with one row for each "winning" model in `model` from [get_winning_model()]. The `data.frame` will have the variables returned by the `tkstats_fun` for its corresponding model. (For the built-in models `model_flat`, `model_1comp`, and `model_2comp`, these variables are `param_name` and `param_value`.) Additionally, there will be a variable `method` denoting the [optimx::optimx()] method used to optimize the set of model parameters used to derive each set of TK statistics.
A [pk()] model object. Must be fitted, or the function will exit with an error.
Optional: A `data.frame` containing new data for which to compute the TK stats. Must contain at least variables `Chemical`, `Species`, `Route`, `Media`, `Dose`, `Dose.Units`, `Conc.Units`, either `Time_trans.Units` or `Time.Units`, and any other variables named in `tk_grouping`. Default `NULL`, to use the data in `obj$data`.
Character: One or more of the models fitted. Default `NULL` to return TK stats for all models.
Character: One or more of the [optimx::optimx()] methods used. Default `NULL` to return TK stats for all methods.
A list of variables provided using a `alist` call. The data (either `newdata` or `obj$data`) will be grouped according to the unique combinations of these variables. For each unique combination of these variables in the data, a set of TK statistics will be computed. The default is `obj$pk_groups$nca_group`, to derive TK statistics for the same groups of data as non-compartmental analysis statistics. With the default, you can directly compare e.g. a model-predicted AUC_inf to the corresponding NCA-estimated AUC_inf. However, you may specify a different data grouping if you wish. Each group should have a unique combination of `Chemical`, `Species`, `Route`, `Media`, and `Dose`, because the TK stats depend on these values, and it is required to have one unique set of TK stats per group.
Logical: `TRUE` to get the TK groupings after removing any observations in the data marked for exclusion (if there is a variable `exclude` in the data, an observation is marked for exclusion when `TRUE`). `FALSE` to include all observations when getting the TK groupings, regardless of exclusion status. Default `TRUE`.
Logical: `TRUE` (default) specifies whether the concentrations are dose-normalized.
Logical (Default: TRUE). If FALSE, will include non-finite values for `AUC_infinity` from both compartmental and noncompartmental analysis.
Logical: whether to suppress message printing. If NULL (default), uses the setting in `obj$pk_settings$preprocess$suppress.messages`
Additional arguments not currently in use.
Caroline Ring, Gilberto Padilla Mercado, John Wambaugh
Other methods for fitted pk objects:
AAFE.pk()
,
AFE.pk()
,
AIC.pk()
,
BIC.pk()
,
coef.pk()
,
coef_sd.pk()
,
get_fit.pk()
,
get_hessian.pk()
,
get_tkstats.pk()
,
logLik.pk()
,
predict.pk()
,
residuals.pk()
,
rmse.pk()
,
rsq.pk()