Skip to contents

[Superseded]

This function is largely a legacy function, replaced by make_valid, which is typically called with the $validate method for a PM_result object.

Usage

makeValid(run, tad = F, binCov, doseC, timeC, tadC, limits, ...)

Arguments

run

When the current working directory is the Runs folder, the folder name of a previous run that you wish to use for the npde, which will typically be a number, e.g. 1.

tad

Boolean operator to use time after dose rather than time after start. Default is FALSE.

binCov

A character vector of the names of covariates which are included in the model, i.e. in the model equations and which need to be binned. For example binCov='wt' if "wt" is included in a model equation like V=V0*wt, or binCov=c( 'wt', 'crcl') if both "wt" and "crcl" are included in model equations.

doseC

An integer with the number of dose/covariate bins to cluster, if known from a previous run of this function. Including this value will skip the clustering portion for doses/covariates.

timeC

An integer with the number of observation time bins to cluster, if known from a previous run of this function. Including this value will skip the clustering portion for observation times.

tadC

An integer with the number of time after dose bins to cluster, if known from a previous run of this function. Including this value will skip the clustering portion for time after dose. This argument will be ignored if tad=FALSE.

limits

Limits on simulated parameters. See SIMrun.

...

Other parameters to be passed to SIMrun, especially limits.

Value

The output of makeValid is a list of class PMvalid, which is a list with the following.

  • simdata The combined, simulated files for all subjects using the population mean values and each subject as a template. See SIMparse. This object will be automatically saved to the run, to be loaded with PMload next time.

  • timeBinMedian A data frame with the median times for each cluster bin.

  • tadBinMedian A data frame with the median time after dose (tad) for each cluster bin. This will be NA if tad = FALSE.

  • opDF A data frame with observations, predicitons, and bin-corrected predictions for each subject.

Details

makeValid will create an object suitable for plotting visual predictive checks (VPCs) and prediction-corrected visual predictive checks (pcVPCs). The function will guide the user through appropriate clustering of doses, covariates and sample times for prediction correction using the methods of Bergstrand et al (2011). NOTE: Including TAD is only valid if steady state conditions exist for each patient. This means that dosing is stable and regular for each patient, without changes in amount or timing, and that sampling occurs after the average concentrations are the same from dose to dose. Otherwise observations are NOT superimposable and tad should NOT be used, i.e. should be set to FALSE.

See also

Author

Michael Neely