Skip to contents

[Stable]

Calculates the Percent Target Attainment (PTA)

Usage

makePTA(
  simdata,
  simlabels,
  target,
  target_type,
  success,
  outeq = 1,
  free_fraction = 1,
  start = 0,
  end = Inf,
  icen = "median",
  block = 1,
  ...
)

Arguments

simdata

Can be one of multiple inputs as shown in the examples below using.

  • simEx #PM_sim

  • simEx$data #PM_simlist

  • simEx$data[[1]] #PMsim

  • NPex$post #PM_post

  • NPex$post$data #PMpost

  • NPex$data #PM_data

  • NPex$data$data #PMmatrix

  • "simout.txt" #matches files with wildcard ability, see [SIMparse]

simlabels

Optional character vector of labels for each simulation. Default is c('Regimen 1', 'Regimen 2',...).

target

One of several options.

  • A vector of pharmacodynamic targets, such as Minimum Inhibitory Concentrations (MICs), e.g. c(0.25, 0.5, 1, 2, 4, 8, 16, 32).

  • A single numerical value such as a concentration, e.g. 10.

  • A sampled distribution using makePTAtarget.

  • A list of multiple targets combining the above if multiple target_types are used. If so, the first target can be a vector, but subsequent targets must be single values to avoid factorial expansion of combinations. For example, the first target could be a vector of MICs corresponding to a target_type of "time", the second target a value of 10 corresponding to a target_type of "min", and the third target a value of 50 corresponding to a target_type of "max": target = list(c(0.25, 0.5, 1, 2, 4, 8, 16, 32), 10, 50). The first value can also be a sampled distribution made with makePTAtarget.

target_type

A vector of the type for each target. For any, place a minus sign in front to make the success less than the target ratio, e.g. target_type = c("min", "-min"). Available types:

  • "time" is percent time above target within the time range specified by start and end

  • "auc" is ratio of area under the curve within the time range to target

  • "peak" or "max", ratio of peak/max (synonymous) concentration to target within the time range. Place a minus sign in front to make the success less than the target ratio.

  • "min", is the ratio of minimum concentration to target within the time range. Place a minus sign in front to make the success less than the target ratio.

  • A single numeric value, which must correspond to an observation time common to all PMsim objects in simdata, rounded to the nearest hour. In this case, the target statistic will be the ratio of observation at that time to target.

This enables testing of a specific timed concentration (e.g. one hour after a dose or C1). Be sure that the time in the simulated data is used, e.g., 122 after a dose given at 120. Place a minus sign in front to make the success less than the target ratio.

success

A vector specifying the success statistics, e.g. 0.4 for proportion time (end-start) above target, and/or 100 for max:target. For example success = 0.4 or success = c(0.4, 100). The length must be the same as for target and target_type.

outeq

An integer specifying the number of the simulated output equation to use. Default is 1.

free_fraction

Proportion of free, active drug, expressed as a numeric value >=0 and <=1. Default is 1, i.e., 100% free drug or 0% protein binding.

start

Specify the time to begin PTA calculations. Default is a vector with the first observation time for subjects in each element of simdata, e.g. dose regimen. If specified as a vector, values will be recycled as necessary.

end

Specify the time to end PTA calculations so that PTA is calculated from start to end. Default for end is the maximum observation time for subjects in each element of simdata, e.g. dose regimen. If specified as a vector, values will be recycled as necessary. Subjects with insufficient data (fewer than 5 simulated observations) for a specified interval will trigger a warning. Ideally then, the simulated datset should contain sufficient observations within the interval specified by start and end.

icen

Can be either "median" for the predictions based on medians of pred.type parameter value distributions, or "mean". Default is "median".

block

Which block to plot, where a new block is defined by dose resets (evid = 4); default is 1.

...

Not currently used

Value

The output of makePTA is a list of class PMpta, which is a list with each target_type as an element, followed by a final intersection element showing the results for profiles which meet ALL the conditions (intersection) or NA if only one target_type was specified. The individual elements are tibbles with all possible combinations of targets and simulated regimens for a given target_type. The tibbles have the following columns:

  • sim_num The simulation number in simdata.

  • label Annotation of the simulation, supplied by the simlabels argument.

  • target is the specified target for the results row. If a distribution created by makePTAtarget, this will be a tibble with the simulated targets

  • type is the specified target_type for the results row

  • success_ratio The specified success metric for the results row

  • prop_success The proportion of profiles meeting the success_ratio for the results row

  • success A tibble of success (1) or not (0) for each profile for the results row

  • pdi A tibble of the pharmacodynamic index, i.e. the ratio or time above for each profile for the results row

  • start The start time used for the results row

  • end The end time used for the results row. For the $intersect item in the return list, the columns are the same, but the target and target_type will reflect all requested values expressed in parenthetical multiplication format to emphasize intersection, e.g., (auc)(min). Simulated (rather than discrete) targets made with makePTAtarget will be abbreviated as "(sim)", e.g. (sim)(5) for a combination of simulated targets and a single concentration target of 5.

Details

makePTA will calculate the PTA for any number of simulations, targets and definitions of success. Simulations typically differ by dose, but may differ by other features such as children vs. adults.

See also

Author

Michael Neely and Jan Strojil

Examples

library(PmetricsData)
pta1 <- PM_pta$new(simEx, 
                 simlabels = c("600 mg daily", "1200 mg daily", "300 mg bid", "600 mg bid"),
                 target = list(2^(-2:6), 1, 50),
                 target_type = c("time", 144, "-max"),
                 success = c(0.6, 1, 1),
                 start = 120, end = 144)
#> 
#> Calculating PTA for each simulated regimen and target...
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |=================================                                     |  48%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |=====================================                                 |  52%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |======================================================================| 100%

pta2 <- PM_pta$new(simEx,
                 target = c(2^(-2:6)),
                 target_type = "time",
                 success = 0.6,
                 start = 120, end = 144)
#> 
#> Calculating PTA for each simulated regimen and target...
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |==============                                                        |  19%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================                                                   |  28%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |===================================================                   |  72%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |========================================================              |  81%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%

pta3 <- PM_pta$new(simEx,
                 simlabels = c("600 mg daily", "1200 mg daily", "300 mg bid", "600 mg bid"),
                 target = list(5,10),
                 target_type = c("min", "-min"),
                 success = c(1,1),
                 start = 120, end = 144)
#> 
#> Calculating PTA for each simulated regimen and target...
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |======================================================================| 100%

pta4 <- PM_pta$new(simEx,
                 simlabels = c("600 mg daily", "1200 mg daily", "300 mg bid", "600 mg bid"),
                 target = makePTAtarget(mic1),
                 target_type = "auc",
                 success = 200,
                 start = 120, end = 144)
#> 
#> Calculating PTA for each simulated regimen using simulated targets...
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |======================================================================| 100%

pta5 <- PM_pta$new(simdata = simEx,
                 simlabels = c("600 mg daily", "1200 mg daily", "300 mg bid", "600 mg bid"),
                 target = list(makePTAtarget(mic1),5),
                 target_type = c("auc","min"),
                 success = c(200,1),
                 start = 120, end = 144)
#> 
#> Calculating PTA for each simulated regimen using simulated targets...
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |======================================================================| 100%