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
)

Arguments

obs.data

data.frame; Observed data

typ.data

data.frame; Typical (population) curves

sim.data

data.frame; Simulated (VPC) data

covariates

named character vector; Covariate names with reference values in vachette transformation

ref.dosenr

integer; Dose number to use as the reference dose, corresponding to value in "dosenr" column in input data

log.x

logical; Apply log(x) conversion. Default FALSE

iiv.correction

logical; Apply inter-individual variability correction. Default FALSE

error.model

character; Applied error model, "proportional" or "additive". Default "proportional"

model.name

character; Optional model name for plot output

mappings

named character vector; Optional mappings to be included if column names in input data.frame differ from required column names. See Required Columns section:

Value

vachette_data

Details

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)

Required columns 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

Required columns typ.data

  • "ID" - Subject ID

  • "x" - Typically time

  • "PRED" - Population prediction

  • "dosenr" - Dose number; unique dose number for ID/time point

Required columns 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

Examples

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