View source: R/f_dispensing_models.R
f_dispensing_models | R Documentation |
Fits drug dispensing models to the observed drug dispensing data.
f_dispensing_models(
vf,
dosing_schedule_df,
model_k0,
model_t0,
model_t1,
model_ki,
model_ti,
model_di,
nreps,
showplot = TRUE
)
vf |
A data frame for subject-level drug dispensing data,
including the following variables:
|
dosing_schedule_df |
A data frame providing dosing schedule
information. It contains the following variables:
|
model_k0 |
The model for the number of skipped visits between randomization and the first drug dispensing visit. Options include "constant", "poisson", "zero-inflated poisson", and "negative binomial". |
model_t0 |
The model for the gap time between randomization and the first drug dispensing visit when there is no visit skipping. Options include "constant", "exponential", "weibull", "log-logistic", and "log-normal". |
model_t1 |
The model for the gap time between randomization and the first drug dispensing visit when there is visit skipping. Options include "least squares", and "least absolute deviations". |
model_ki |
The model for the number of skipped visits between two consecutive drug dispensing visits. Options include "constant", "poisson", "zero-inflated poisson", and "negative binomial". |
model_ti |
The model for the gap time between two consecutive drug dispensing visits. Options include "least squares" and "least absolute deviations". |
model_di |
The model for the dispensed doses at drug dispensing visits. Options include "constant", "linear model", and "linear mixed-effects model". |
nreps |
The number of simulations for drawing posterior model parameters. |
showplot |
A Boolean variable that controls whether or not to
show the model fit plot. It defaults to |
A list with the following components:
common_time_model
: A Boolean variable that indicates
whether a common time model is used for drug dispensing visits.
k0_fit
: The model fit for the number of skipped
visits between randomization and the first drug dispensing visit.
t0_fit
: The model fit for the gap time between
randomization and the first drug dispensing visit when there is
no visit skipping.
t1_fit
: The model fit for the gap time between
randomization and the first drug dispensing visit when there is
visit skipping.
ki_fit
: The model fit for the number of skipped
visits between two consecutive drug dispensing visits.
ti_fit
: The model fit for the gap time between two
consecutive drug dispensing visits.
di_fit
: The model fit for the dispensed doses at drug
dispensing visits.
Kaifeng Lu, kaifenglu@gmail.com
f_fit_t0
, f_fit_ki
,
f_fit_ti
, f_fit_di
library(dplyr)
observed <- f_dose_observed(df2, visitview2, showplot = FALSE)
dispensing_models <- f_dispensing_models(
observed$vf, dosing_schedule_df,
model_k0 = "zero-inflated poisson",
model_t0 = "log-logistic",
model_t1 = "least squares",
model_ki = "zero-inflated poisson",
model_ti = "least squares",
model_di = "linear mixed-effects model",
nreps = 200, showplot = FALSE)
dispensing_models$ki_fit$fit_plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.