# Fits Toxicokinetic Models to In Vivo PK Data Sets

## Documentation for package ‘invivoPKfit’ version 2.0.2

- DESCRIPTION file
- User guides, package vignettes and other documentation
- Package NEWS
- Package README

## Help Pages

A B C D E F G H I L M N P R S T misc

## -- A --

AAFE | AAFE()
AAFE.default | Default method for AAFE()
AAFE.pk | Calculate absolute average fold error (AAFE)
add_pk | Add various 'pkproto' objects to a 'pk' object
adjust_model_name | Sets the 'name' element for models to the 'pk_model' object name in the environment
AFE | AFE()
AFE.default | Default method for AFE()
AFE.pk | Calculate average fold error
AIC.pk | Akaike information criterion
auc_1comp | Analytic AUC for 1-compartment model
auc_2comp | Analytical AUC for the 2-compartment model
auc_flat | AUC for flat model
auc_httk_gas_pbtk | Calculates AUC for 'httk''s 'gas_pbtk' PBPK model
auto_units | Automatically select new time units

## -- B --

BIC.pk | Bayesian information criterion

## -- C --

calc_hessian | Calculate Hessian
calc_nca | Non-compartmental analysis
calc_rmse | Calculate RMSE (root mean squared error)
calc_rsq | Calculate r-squared for observed vs. predicted values
calc_sds_alerts | Calculate parameter SDs
check_group_hierarchy | Checking data, error, and summary group hierarchical structure
check_method | Check methods
check_model | Check models
check_newdata | Check new data
check_params_1comp | Check 1-compartment model parameters
check_params_2comp | Check 2-compartment model parameters
check_params_flat | Check flat model parameters
check_required_status | Check required status
check_required_status.default | Default method for checking required status
check_required_status.pk | Check required status
coef.pk | Get coefficients
coef_sd | Coefficient standard deviations
coef_sd.default | Coefficient standard deviation default
coef_sd.pk | Get coefficient standard deviations
combined_sd | Combined standard deviation
compare_models | Model comparison
compare_models.default | Default method for compare_models()
compare_models.pk | Model comparison for [pk()] objects
conc_scale_use | Get concentration scalings
convert_summary_to_log10 | Convert sample mean and SD to log10-scale
convert_time | Helper function to convert time units
cp_1comp | Analytical 1-compartment model
cp_2comp | Analytical 2-compartment model
cp_2comp_dt | Time derivative of analytical 2-compartment model
cp_flat | Flat model
cp_httk_gas_pbtk | Calculates plasma concentration for 'httk''s 'gas_pbtk' model
cvt | CvTdb data
cvtdb_original | SQL query result (current)
cvt_2.0.0 | CvTdb data for invivoPKfit 2.0.0 release (old)
cvt_date | CvTdb download date

## -- D --

data_summary | data_summary()
data_summary.default | Default method for data_summary()
data_summary.pk | Data summary for a 'pk' object
dlnorm_summary | Log-normal distribution density function for summary data
dnorm_summary | Normal distribution density function for summary data
do_data_info | do_data_info generic
do_data_info.default | do_data_info default method
do_data_info.pk | calculate summary data info
do_fit | Fitting
do_fit.default | do_fit default method
do_fit.pk | Do fitting
do_prefit | Prefitting
do_prefit.default | do_prefit default method
do_prefit.pk | Do pre-fitting
do_preprocess | Preprocess data generic
do_preprocess.default | do_preprocess default method
do_preprocess.pk | Do pre-processing

## -- E --

eval_tkstats | eval_tkstats()
eval_tkstats.default | Default method for eval_tkstats()
eval_tkstats.pk | Evaluate TK statistics

## -- F --

facet_data | Facet a PK fit
fill_params_1comp | Fill parameters for 1-compartment model
fill_params_2comp | Fill parameters for 2-compartment model
fill_params_flat | Fill parameters for flat model
fit_group | Fit a single group of data
fit_sigma.pk | Hyperparameter fitting
fold_error | Fold error
fold_error.default | fold_error default method
fold_error.pk | Fold errors

## -- G --

get_data | get_data()
get_data.default | Default method for get_data()
get_data.pk | Get data
get_data_group | get_data_group()
get_data_group.default | Default method for get_data_group()
get_data_group.pk | Get data grouping
get_data_info | get_data_info()
get_data_info.default | Default method for get_data_info()
get_data_info.pk | Get data_info
get_data_original | get_data_original()
get_data_original.default | Default method for get_data_original()
get_data_original.pk | Get data_original
get_data_sigma_group | get_data_sigma_group()
get_data_sigma_group.default | Default method for get_data_sigma_group()
get_data_sigma_group.pk | Get data_sigma_group
get_data_summary | get_data_summary()
get_data_summary.default | Default method for get_data_summary()
get_elbow | Get an elbow point
get_error_group | get_error_group()
get_error_group.default | Default method for get_error_group()
get_error_group.pk | Get error group
get_fit | get_fit()
get_fit.default | Default method for get_fit()
get_fit.pk | Get fits from a 'pk' object
get_hessian | get_hessian()
get_hessian.default | Default method for get_hessian()
get_hessian.pk | Get Hessian matrixes
get_mapping | get_mapping()
get_mapping.default | Default method for get_mapping()
get_mapping.pk | Get mapping
get_nca | get_nca()
get_nca.default | Default method for get_nca()
get_nca.pk | Get NCA
get_nca_group | get_nca_group()
get_nca_group.default | Default method for get_nca_group()
get_nca_group.pk | Get nca_group
get_params_1comp | Get parameters for 1-compartment model
get_params_2comp | Get parameters for 2-compartment model
get_params_flat | Get parameters to be optimized for flat model
get_params_httk_gas_pbtk | Get parameters to fit 'httk''s 'gas_pbtk' PBPK model
get_peak | Find the peak of a data series
get_prefit | get_prefit()
get_prefit.default | Default method for get_prefit()
get_prefit.pk | Get prefit
get_scale_conc | get_scale_conc()
get_scale_conc.default | Default method for get_scale_conc()
get_scale_conc.pk | Get scale_conc
get_scale_time | get_scale_time()
get_scale_time.default | Default method for get_scale_time()
get_scale_time.pk | Get scale_time
get_settings_optimx | get_settings_optimx()
get_settings_optimx.default | Default method for get_settings_optimx()
get_settings_optimx.pk | Get settings_optimx
get_settings_preprocess | get_settings_preprocess()
get_settings_preprocess.default | Default method for get_settings_preprocess()
get_settings_preprocess.pk | Get settings_preprocess
get_starts_1comp | Get starting values for 1-compartment model
get_starts_2comp | Get starting values for 2-compartment model
get_starts_flat | Get starting values for flat model
get_starts_httk_gas_pbtk | Get starting values for httk 'gas_pbtk' model with specific clearance
get_status | Get status
get_status.default | Default method for getting status
get_status.pk | Check status of a 'pk' object
get_stat_model | get_stat_model()
get_stat_model.default | Default method for get_stat_model()
get_stat_model.pk | Get stat_model
get_tkstats | Get TK stats
get_tkstats.default | Default method for get_tkstats()
get_tkstats.pk | Get TK stats
get_winning_model | get_winning_model()
get_winning_model.default | Default method for get_winning_model()
get_winning_model.pk | Get winning model

## -- H --

hess_sd1 | Inverse diagonal, method 1
hess_sd2 | Inverse diagonal, method 2

## -- I --

ignore_unused_imports | Ignore unused imports
is.pk | Check whether an object is of class 'pk'
is.pkproto | Is an object pkproto?
is.pk_faceted | Check whether an object is of class 'pk_faceted'
is.pk_model | Checks whether object is of class 'pk_model'
is.pk_scales | Is an object class 'pk_scales'?

## -- L --

logLik.pk | Log-likelihood
log_likelihood | Log-likelihood

## -- M --

mapping | New mapping
midpt_log10 | Log10-scaled midpoint
model_1comp | 1-compartment model
model_2comp | 2-compartment model
model_flat | Flat model
model_httk_gas_pbtk | Gas pbtk 'httk' model

## -- N --

nca | nca()
nca.default | Default method for nca()
nca.pk | NCA for a 'pk' object

## -- P --

pk | Create a new 'pk' object
pkdataset_nheerlcleaned | Toxicokinetic data from the "Concentration vs. Time Database"
pk_add | Add a 'pkproto' object to a 'pk' object
pk_add.default | Add pkproto object default method
pk_add.pk_facet_data | Add facet_data()
pk_add.pk_loq_group | Add loq_group
pk_add.pk_nca_group | Add a 'pk_nca_group' object.
pk_add.pk_scales | Add a 'pk_scales' object to a 'pk' object.
pk_add.pk_sd_group | Add sd_group
pk_add.pk_settings_optimx | Add a 'pk_settings_optimx' object.
pk_add.pk_settings_preprocess | Add a 'pk_settings_preprocess' object.
pk_add.pk_stat_error_model | Add a 'pk_stat_error_model' object.
pk_add.pk_stat_model | Add a 'pk_stat_model' object.
pk_add.uneval | Add an 'uneval' object
pk_model | Create a new 'pk_model' object
pk_subtract | Subtract a 'pkproto' object from a 'pk' object
pk_subtract.default | Subtract pkproto object default method
pk_subtract.pk_stat_model | Subtract a 'pk_stat_model' object.
plot.pk | Plot a [pk()] object.
post_name_value | Creates a [cli::cli_fmt()] output for the pattern "name(x), length = "
predict.pk | Get predictions
print.pk | Print a user-friendly version of a 'pk' object
pseudo_cvt | Creating a simple test CvT dataset

## -- R --

recalculate_httk_pbtk_params | Recalculating parameters for 'httk''s pbtk or gas_pbtk model
rename2_cvt | Convert invivoPKfit output table names to the CvTdb names
residuals.pk | Get residuals
rmse | Root mean squared error (RMSE)
rmse.default | Root mean squared error (RMSE) default method
rmse.pk | Root mean squared error
rowwise_calc_percentages | Helper function for calculating percentages of count data, by row
rsq | rsq()
rsq.default | Default method for rsq()
rsq.pk | Calculate R-squared for observed vs. predicted values

## -- S --

scale_conc | Scale concentrations
scale_time | Scale times
settings_optimx | 'optimx' optimizer settings
settings_preprocess | Data preprocessing settings
set_params_optimize | Set model parameters to optimize
set_params_starts | Set model parameter starts
status_data_info | Status ID for data summary info
status_fit | Status ID for fitting
status_init | Status ID for initialization
status_prefit | Status ID for pre-fitting
status_preprocess | Status ID for preprocessing
stat_error_model | Error model
stat_loq_group | LOQ Group
stat_model | Add PK model(s) to be fitted
stat_nca_group | NCA group
stat_sd_group | SD Group
subtract_pk | Subtract various 'pkproto' objects from a 'pk' object
summary.pk | Print summary of a 'pk' object

## -- T --

time_conversions | Time conversion table
time_units | Allowable time units
tkstats_1comp | Toxicokinetic statistics for 1-compartment model
tkstats_2comp | Toxicokinetic statistics for 1-compartment model
tkstats_flat | TK stats for flat model
tkstats_httk_gas_pbtk | TK stats for gas_pbtk model fit with inivivoPKfit
toggle_clearance_mode | Switch between model parameters to optimize
transformed_params_2comp | Transformed parameters for 2-compartment model
twofold_test | twofold_test()
twofold_test.default | Default method for twofold_test()
twofold_test.pk | Evaluate whether data and predictions are within two-fold of mean or concentration, respectively

## -- misc --

+.pk | Add a 'pkproto' object to a 'pk' object
-.pk | Subtract a pkproto object from a pk object