pkm | R Documentation |
Fits a two-compartment model to obtain posterior estimates of concentration of drug over time.
pkm(
formula,
data,
subset,
ivt,
pars = c(getOption("pkpredict.pip.default.prior")$log_pk_mean,
getOption("pkpredict.pip.default.prior")$log_err_mean),
alp = 0.05,
cod = 12,
thres = 64,
timeint = c(0, max(sapply(ivt, function(x) x$end)) + cod),
mcmc = FALSE,
nreps = 5000,
nburnin = 2000,
nthin = 10,
seed = NULL,
shiny = FALSE,
...
)
formula |
A formula where the left side is the measured concentration of drug and the right side is the times of concentration measurements |
data |
Data frame with concentration data (time of measurement in hours and concentration in mcg/ml) |
subset |
Subset of the |
ivt |
List with containing start of infusion times, end of infusion times, and rate of infusion at each dose |
pars |
Vector of (prior) log-pharmacokinetic parameters of length 5: (lv_1, lk_10, lk_12, lk_21, lerr) |
alp |
Value of alpha to use for generating pointwise (1 - |
cod |
Length of time after end of last dose to consider |
thres |
Threshold for effective treatment (mcg/ml) |
timeint |
time interval over which to compute estimate |
mcmc |
logical: should estimate of time above threshold be computed using MCMC (false = laplace approximation) |
nreps |
number of MCMC iterations to perform (including burn in) |
nburnin |
number of burn in replications to perform |
nthin |
mcmc thinning interval |
seed |
seed for replicating MCMC results |
shiny |
is this being used within shiny_pkm |
... |
additional arguments (e.g., 'mu', 'sig', 'ler_mean', 'ler_sdev' for changing the PK parameter prior mean, variance-covariance matrix and error prior mean and standard deviation, respectively) |
Measurements must be entered in particular units: mcg/ml for concentrations, g/h in rate of infusion, hours for times.
posterior estimates
ivt_d <- list(list(begin=0.0, end=0.5, k_R=6),
list(begin=8.0, end=8.5, k_R=6),
list(begin=16.0, end=16.5, k_R=6))
dat_d <- data.frame(time_h = c(1,4,40), conc_mcg_ml = c(82.7,80.4,60))
pkm(conc_mcg_ml ~ time_h, data = dat_d, ivt = ivt_d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.