Skip to contents

Reshape NONMEM data into PKPDposterior-ready or Stan-ready data

Usage

nonmem_to_stan_data(
  nm,
  covariate_cols,
  parameters,
  iiv,
  ruv,
  covariates_implementation = list(),
  dose_cmt = 1,
  ltbs = FALSE,
  verbose = FALSE
)

Arguments

nm

NONMEM data frame for a single patient, with columns for TIME, EVID, DV, and AMT. Observations in DV are assumed to be taken from compartment 2 unless otherwise specified in an (optional) "CMT" column.

covariate_cols

names of columns in nm that should be used as covariates

parameters

list of population parameters, e.g. list(CL = 5, V = 50)

iiv

list of inter-individual variability for parameters. Should have exact same list elements as parameters, and magnitude supplied on SD scale.

ruv

magnitude of residual unexplained variability (RUV). Should be a list specifying proportional and/or additive error magnitude on standard deviation scale, e.g. list("prop" = 0.1, "add" = 1). If ltbs is TRUE, should specify only an add part, which applies an additive error on the log-scale (which then becomes an approximate proportional error).

covariates_implementation

named list indicating which implementation method should be used for each covariate. See PKPDsim::new_covariate for options.

dose_cmt

Specify what dose compartment. Observation compartment in dataset is irrelevant, handled in model.

ltbs

use log-transform-both-sides approach for observations? Default is FALSE.

verbose

verbosity

Value

Named list suitable for passing on to Torsten.