Learn R Programming

dfpk (version 3.3.0)

nsim: Simulate one or more Phase I clinical trial(s) using the PK measure in the dose finding design.

Description

nsim is used to generate "n" simulations of phase I trial using the PK data and then link them to toxicity under a specified dose-toxicity configuration. The objective is to determine the maximum tolerated dose (MTD).

Usage

nsim(doses, N, cohort, icon, theta, model, simulatedData, TR, prob = 0.9, AUCmethod = 2, 
     options = list(nchains = 4, niter = 4000, nadapt = 0.8), betapriors = NULL,
     thetaL=NULL, p0 = 0, L = 0, seed = 190591)

Arguments

doses

A vector with the doses panel.

N

The total number of enrolled patients.

cohort

The number of cohorts in the trial.

icon

The index of real blood sampling.

theta

The toxicity target.

model

A character string to specify the working dose-finding model.

simulatedData

A generated simulated PK and toxicity data; a "scen" object. See for details sim.data.

TR

The number of replicates clinical trials.

prob

The probability of toxicity for the corresponding stopping rule of the selected model; defaults to 0.9. See for details dtox, pkcov, pkcrm, pktox, pkpop, pklogit.

AUCmethod

A string number specifying the method for calculation of AUC. Possible values are "1" for a compartmental method and "2" for non-compartmental method (default=2).

options

A list with the Stan model's options; the number of chains, how many iterations for each chain and the number of warmup iterations; defaults to options = list(nchains = 4, niter = 4000, nadapt = 0.8)

betapriors

A vector with the value for the prior distribution of the regression parameters in the model; defaults to NULL.

thetaL

A second threshold of AUC; must be defined only in the PKCRM model.

p0

The skeleton of CRM for pkcrm; defaults to NULL (must be defined only in the PKCRM model).

L

The AUC threshold to be set before starting the trial for pklogit, pkcrm and pktox; defaults to NULL (must be defined only in the PKCRM model).

seed

Seed of the random number generator. Default value is set at 190591.

Value

An object of class "dosefinding" is returned, consisting of determination of the next recommended dose and estimations. Objects generated by nsim contain at least the following components:

pid

The patient's ID during the trial.

N

The total number of enrolled patients.

time

The time sampling.

doses

A vector with the doses panel.

conc

The concentration of the drug in blood plasma.

nchains

The number of chains for the Stan model.

niter

The number of iterations for each chain in the Stan model.

nadapt

The number of warmup iterations.

newDose

The next maximum tolerated dose (MTD) if TR=1 otherwise the percentage of MTD selection for each dose level starting from dose 0; equals to 0 if the TR=1 has stopped before the end, according to the stopping rules.

MTD

A vector containing the next maximum tolerated doses (MTD) of each trial (TR); equals to 0 if the trial has stopped before the end, according to the stopping rules.

theta

Tocixity target.

doseLevels

A vector of dose levels assigned to patients in the trial.

toxicity

The estimated toxicity outcome.

AUCs

A vector with the computed AUC values of each patient.

TR

The number of replicates clinical trials.

preal

Prior toxicity probabilities.

pstim

The mean values of estimated probabilities of toxicity.

pstimQ1

The 1st quartile of estimated probabilities of toxicity.

pstimQ3

The 3rd quartile of estimated probabilities of toxicity.

model

A character string of the selected working dose-finding model.

References

Ursino, M., et al, (2017) Dose-finding methods for Phase I clinical trials using pharmacokinetics in small populations, Biometrical Journal.

See Also

sim.data

Examples

Run this code
    
        TR = 10                                 # Total number of simulations                 
        N = 30                         
        limitTox <- 10.96 
        PKparameters <- c(2, 10, 100)             # PK parameters ka,CL,V
        omegaIIV <- 0.7                        
        omegaAlpha <- 0
        doses <- c(12.59972, 34.65492, 44.69007, 60.80685, 83.68946, 100.37111)     
        timeSampling <- seq(0, 24, length.out=48)    
        sigma <- rep(0.2, length(timeSampling))         

        gen.scen <- sim.data(PKparameters,omegaIIV,omegaAlpha,sigma,doses,
                             limitTox,timeSampling, N, TR)

        cohort = 1
        simulatedData <- gen.scen  
        icon <- c(2:6, round(seq(9, 48, ((48-9)/4))))      
        theta <- 0.2                             

        ##############################################
        ############### Select a model ###############
        ##############################################

        model = "pktox"

        ############################################
        ############ Run the simulation(s) #########
        ############################################
        
        results_sim <- nsim(doses, N, cohort, icon, theta, model, simulatedData, TR, 
                            AUCmethod = 1)
        results_sim
    

Run the code above in your browser using DataLab