f_ongoing_new {drugDemand} | R Documentation |
Observed Dosing for Ongoing and New Subjects
Description
Prepares the dosing data sets to impute for ongoing and new subjects.
Usage
f_ongoing_new(newEvents, kit_description_df, treatment_by_drug_df, vf)
Arguments
newEvents |
A data frame containing the imputed event data
for both ongoing and new patients, typically obtained from
the output of the |
kit_description_df |
A data frame indicating the
drug and kit descriptions, including the following variables:
|
treatment_by_drug_df |
A data frame indicating the treatments
associated with each drug, including the following variables:
|
vf |
A data frame for subject-level drug dispensing data,
including the following variables:
|
Value
A list with the following components:
-
vf_ongoing
: A data frame for the observed drug dispensing data for ongoing patients with drug dispensing records. It includes the following variables:draw
,kit
,kit_name
,usubjid
,day
,dose
,arrivalTime
,treatment
,treatment_description
,time
, andtotalTime
. -
vf_new
: A data frame for the randomization date for new patients and ongoing patients with no drug dispensing records. It includes the following variables:draw
,kit
,kit_name
,usubjid
,arrivalTime
,treatment
,treatment_description
,time
, andtotalTime
.
Author(s)
Kaifeng Lu, kaifenglu@gmail.com
Examples
set.seed(2000)
pred <- eventPred::getPrediction(
df = df2,
to_predict = "event only",
target_d = 250,
event_model = "log-logistic",
dropout_model = "none",
pilevel = 0.95,
nyears = 1,
nreps = 200,
showplot = FALSE,
by_treatment = TRUE)
observed <- f_dose_observed(df = df2, visitview = visitview2)
vf_ongoing_new <- f_ongoing_new(
pred$event_pred$newEvents,
observed$kit_description_df,
observed$treatment_by_drug_df,
observed$vf)
head(vf_ongoing_new$vf_ongoing)
head(vf_ongoing_new$vf_new)