Learn R Programming

invivoPKfit (version 2.0.2)

eval_tkstats.pk: Evaluate TK statistics

Description

Evaluate TK statistics from a fitted model by comparing to NCA results

Usage

# 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,
  ...
)

Value

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.

Arguments

obj

A [pk()] model object. Must be fitted, or the function will exit with an error.

newdata

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`.

model

Character: One or more of the models fitted. Default `NULL` to return TK stats for all models.

method

Character: One or more of the [optimx::optimx()] methods used. Default `NULL` to return TK stats for all methods.

tk_group

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.

exclude

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`.

dose_norm

Logical: `TRUE` (default) specifies whether the concentrations are dose-normalized.

finite_only

Logical (Default: TRUE). If FALSE, will include non-finite values for `AUC_infinity` from both compartmental and noncompartmental analysis.

suppress.messages

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.

Author

Caroline Ring, Gilberto Padilla Mercado, John Wambaugh

See Also

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()