demodelFit: Fit dose escalation models

Description Usage Arguments Value References Examples

View source: R/demodelFit.R

Description

demodelFit fit dose escalation model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
demodelFit(
  data,
  formula = NULL,
  method = "blrm",
  mbdInfo = MBInfo(),
  madInfo = NULL,
  pkpdInfo = NULL,
  predict = NULL,
  multiSce = NULL,
  bayesInfo = BayesInfo(),
  control = demodelControl()
)

Arguments

data

A data.frame or data.table or a string. If data is a string, it should gives the path of trial data. Trial data should be either .xlsx or .csv

formula

A formula. See examples.

method

A string. Currently, only blrm is allowed.

mbdInfo

A named list. Trial information. See example.

madInfo

Currently not available.

pkpdInfo

Currently not available.

predict

a data.frame or data.table. When covariates are included, predict should be provided. Otherwise, every unique combinations of covariates will be considered as predictors.

multiSce

a formula. The column name of Scenario indicator.

bayesInfo

a named list. See BayesInfo.

control

a named list. See demodelControl.

Value

This function will generate a excel report including tables and figures

References

\insertRef

blrm2008demodel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
## Not run: 
# Single-agent without covariates

# Create multiple scenario data
npat.ms <- c(3, 4, 3, 3, 4, 4)
dose.ms <- c(80, 120, 160, 160, 160, 200)
nDLT.ms <- c(0, 0, 0, 1, 0, 1)
Scenario <- c(1, 2, 3, 3, 4, 4)
data <- data.frame(npat = npat.ms, DSPX = dose.ms, nDLT = nDLT.ms, Scenario = Scenario)


# design info ----------------------------------------------------------------------------

MB.Info <- MBInfo(dose.levels = list(DSPX = c(80, 120, 160, 200, 240, 280)),
                  ref.dose = 120,
                  bounds = c(0.16, 0.33),
                  ewoc = 0.25,
                  trial.name = "DSP-509",
                  drug.name = "DSP509",
                  drug.unit = "mg")

# Bayes Info ---------------------------------------------------------------------------

Bayes.Info <- BayesInfo(MCMCpackage = "rjags",
                        prior = list(mean = list(c(-1.7346, 0)), std = list(c(2, 1)), corr = list(0)),
                        init.list = list(list(paras1 = c(-3, 0), .RNG.seed = 1, .RNG.name="base::Wichmann-Hill"),
                                         list(paras1 = c(-3, 0), .RNG.seed = 2, .RNG.name="base::Wichmann-Hill")),
                        n.sample = 10000,
                        n.burn = 2000,
                        n.adapt = 1000,
                        n.chain = 2,
                        n.thin = 1)


demodel.MS <- demodelFit(data = data,
                         formula = cbind(nDLT, npat) ~ DSPX,
                         method = "blrm",
                         mbdInfo = MB.Info,
                         bayesInfo = Bayes.Info,
                         multiSce = ~ Scenario,
                         control = demodelControl(code.name = "demodel_core.R",
                                                  output.path = getwd(),
                                                  table.file.name = "preview.xlsx",
                                                  fig.file.name = NULL))

## End(Not run)

# Combo with covariates
## Not run: 

# design info ----------------------------------------------------------------------------

MB.Info <- MBInfo(dose.levels = list(DSPX1 = c(0.3, 0.6, 1, 1.8, 3), DSPX2 = c(200, 400, 600, 800)),
                  ref.dose = c(2.4, 400),
                  bounds = c(0.16, 0.33),
                  ewoc = 0.25,
                  trial.name = "DSPX2333",
                  drug.name = c("DSPX1", "DSPX2"),
                  drug.unit = c("mg BID", "mg QD"))

# Bayes Info ---------------------------------------------------------------------------

seeds <- 1:4

Bayes.Info <- BayesInfo(MCMCpackage = "rjags",
                        prior = list(mean = list(c(-1.7346, 0, 0.77, 0.98), c(-2.9444, 0, 0.44, 0.23), 0),
                                     std = list(c(2, 1, 0.5, 1.2), c(2, 1, 1, 1.4), 1.12),
                                     corr = list(diag(1, 4),diag(1, 4))),
                        init.list = list(list(paras1 = c(-3, 0, -0.5, 0.7), paras2 = c(-2, 0, 0.78, 0.23), eta = 0.1, .RNG.seed = seeds[1], .RNG.name = "base::Wichmann-Hill"),
                                         list(paras1 = c(-2, 0, 0.89, -0.98), paras2 = c(-3, 0, 0.32, -0.54), eta = 0, .RNG.seed = seeds[2], .RNG.name = "base::Wichmann-Hill"),
                                         list(paras1 = c(-3, 0.5, 0.65, 0.72), paras2 = c(-3, 0, -0.65, 1.02), eta = 0.1, .RNG.seed = seeds[3], .RNG.name = "base::Wichmann-Hill"),
                                         list(paras1 = c(-2, -0.5, -0.43, 0.67), paras2 = c(-3, 0, -0.98, -1.2), eta = 0, .RNG.seed = seeds[4], .RNG.name = "base::Wichmann-Hill")),
                        n.sample = 10000,
                        n.burn = 2000,
                        n.adapt = 1000,
                        n.chain = 4,
                        n.thin = 1)

# run BLRM
demodel.combo.MS.cov <- demodelFit(data = blrm_comb_cov_data,
                                   formula = DLT ~ DSPX1 + DSPX2 | Azole + Cytarabine,
                                   method = "blrm",
                                   mbdInfo = MB.Info,
                                   bayesInfo = Bayes.Info,
                                   multiSce = ~ Scenario,
                                   control = demodelControl(code.name = "demodel_core.R",
                                                            output.path = getwd(),
                                                            table.file.name = "preview.xlsx",
                                                            fig.file.name = NULL))



## End(Not run)

CChen89/demodel documentation built on Dec. 17, 2021, 12:52 p.m.