Initialize vachette object with required data
vachette_data(
obs.data,
typ.data,
sim.data = NULL,
covariates,
ref.dosenr,
log.x = FALSE,
iiv.correction = FALSE,
error.model = c("proportional", "additive"),
model.name = NULL,
mappings = NULL
)
data.frame; Observed data
data.frame; Typical (population) curves
data.frame; Simulated (VPC) data
named character vector; Covariate names with reference values in vachette transformation
integer; Dose number to use as the reference dose, corresponding to value in "dosenr" column in input data
logical; Apply log(x) conversion. Default FALSE
logical; Apply inter-individual variability correction. Default FALSE
character; Applied error model, "proportional"
or "additive"
. Default "proportional"
character; Optional model name for plot output
named character vector; Optional mappings to be included if column names in input data.frame
differ from required column names.
See Required Columns section:
vachette_data
If "dosenr" column is missing it will be automatically calculated using the priority of available columns:
"EVID": If available in data, "dosenr" will be calculated using cumsum(EVID==1)
"ADDL"/"II": If "ADDL" and "II" are available in data, "dosenr" will be calculated given additional dose number and interval
"AMT": If only "AMT" column exists in data, "dosenr" will be calculated using cumsum(AMT!=0)
obs.data
"ID"
- Subject ID
"x"
- Typically time
"PRED"
- Population prediction, required if iiv.correction = TRUE
"IPRED"
- Individual prediction, required if iiv.correction = TRUE
"OBS"
- DV
"dosenr"
- Dose number; unique dose number for ID/time point
typ.data
"ID"
- Subject ID
"x"
- Typically time
"PRED"
- Population prediction
"dosenr"
- Dose number; unique dose number for ID/time point
sim.data
"ID"
- Subject ID
"x"
- Typically time
"PRED"
- Population prediction, required if iiv.correction = TRUE
"IPRED"
- Individual prediction, required if iiv.correction = TRUE
"REP"
- Replicate number
obs <- read.csv(system.file(package = "vachette", "examples", "iv-obs.csv"))
typ <- read.csv(system.file(package = "vachette", "examples", "iv-typ-minmax.csv"))
vd <- vachette_data(
obs.data = obs,
typ.data = typ,
covariates = c(WT = 70),
mappings = c(OBS = "DV", x = "time"),
model.name = "IV"
)
#> `EVID` column found in obs.data, creating `dosenr` column in data for corresponding ref.dosenr value
#> `EVID` column found in typ.data, creating `dosenr` column in data for corresponding ref.dosenr value