tsml.cara.rct: Targeted Minimum Loss Covariate-Adjusted Response-Adaptive...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Simulates a targeted minimum loss covariate-adjusted response-adaptive RCT design and statistical analysis.

Usage

1
2
3
4
5
6
7
8
tsml.cara.rct(what = c("ATE", "MOR"), 
    flavor = c("parametric", "lasso"), ninit = 50, by = 25, nmax = 500,
    tm.init = oneOne, tm.ref = oneOne, learnQ,
    tm.model = formula(A ~ 1), tm.control = glm.control(maxit = 500), 
    Gmin = 0.01, Gexploit = Gmin, Gexplore = 0.01, Qmin = 0.01, 
    conf.level = 0.95, verbose = FALSE, piV = c(1/2, 1/3, 1/6), 
    family = c("beta", "gamma"), Qbar = Qbar1, Vbar = Vbar1, 
    Bn = 1e+05, slice.by = 1e+05)

Arguments

what

A character indicating the parameter of interest to estimate. Either "ATE" for the Average Treatment Effect, the difference between the means under 'do(A=1)' and 'do(A=0)', or "MOR" for the Mean under the Optimal treatment Rule 'do(A=r(W))'.

flavor

A character indicating the 'flavor' of the procedure.

ninit

An integer, number of subjects to sample at initialization. Defaults to 50.

by

An integer, number of subjects to sample at each step after initialization. Defaults to 25.

nmax

An integer, maximum number of subjects to sample during the trial. Must be larger than 'ninit+by'. Defaults to 500.

tm.init

A function describing the initial treatment mechanism to be employed. Defaults to the balanced (1:1) treatment mechanism, ie, function oneOne.

tm.ref

A function describing the reference treatment mechanism to be employed. Defaults to the balanced (1:1) treatment mechanism, ie, function oneOne.

learnQ

A model {\cal Q} of conditional expectations of Y given (A,W) for both flavors 'parametric' and 'lasso', given as a formula or a function outputing formulas. Defaults to formula(Y~1) for flavors 'parametric' and 'lasso'.

tm.model

A parametric model {\cal G} of treatment mechanisms, used only when 'what' equals "ATE". The procedure targets the optimal treatment mechanism within this model. Defaults to formula(A~1).

tm.control

A list of options for the targeting of the treatment mechanism within the model defined by argument 'tm.model'. Used only when 'what' equals "ATE", it defaults to glm.control(maxit=500).

Gmin

A small positive numeric, with default value 1e-2. When what equals 'ATE', it is the minimum value of elements of the parametric model {\cal G} of treatment mechanisms (see argument tm.model). The maximum value is 1-Gmin. When what equals 'MOR', it is the minimum value of the conditional probability of A=r_n(W) given W.

Gexploit

A small positive numeric, with default value that of Gmin, or a function of sample size giving such small numbers, only used when what equals "MOR", in conjunction with Gexplore.

Gexplore

Either a small positive numeric, with default value 1e-2, or a function of sample size giving such small numbers, only used when what equals "MOR", in conjunction with Gexploit.

Qmin

A small positive numeric, the minimum value of scaled outcomes Y. The maximum value is 1-Qmin.

conf.level

A numeric, the confidence level of the resulting confidence interval.

verbose

A logical or an integer indicating the level of verbosity (defaults to 'FALSE').

piV

Marginal distribution of V. Defaults to c(1/2, 1/3, 1/6).

family

A character, either "beta" (default) or "gamma", the nature of the law of outcome.

Qbar

A function, the conditional expectation of Y given (A,W). Defaults to Qbar1.

Vbar

A function, the conditional variance of Y given (A,W). Defaults to Vbar1.

Bn

An integer, the sample size used to estimate the true value of the data-adaptive parameter at each step of the procedure when 'what' equals 'MOR'. Defaults to 1e5.

slice.by

An integer. If it is smaller than argument 'n' of 'getSample', then the simulation is decomposed into 'n%/%slice.by' smaller simulations of 'slice.by' observations and one of 'n%%slice.by' observations. Defaults to 1e5 (hence, no decomposition if 'n' smaller than 4e5). Mainly for internal use.

Details

Defines a lower-bound on the conditional probability of do(A=1-r_n(W)) given W.

Value

Returns a TSMLCARA object which summarizes the TSMLCARA undertaken procedure.

Author(s)

Antoine Chambaz [aut, cre]

References

Chambaz, van der Laan, Zheng, Chapter 16, Modern Adaptive Randomized Clinical Trials: Statistical, Operational, and Regulatory Aspects, by A. Sverdlov (CRC Press, 2015).

See Also

update, targetPsi, getSample

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
##
log <- Arguments$getVerbose(-1, timestamp=TRUE)
set.seed(12345)

## ########################
## AVERAGE TREATMENT EFFECT
## ########################
tm.model <- formula(A~.)
psi.sd <- sqrt(getOptVar(n=1e5,
                         tm.model=tm.model,
                         piV=c(1/2, 1/3, 1/6),
                         family="gamma",
                         Qbar=Qbar1,
                         Vbar=Vbar1))
truth <- c(psi=91/72, psi.sd=psi.sd)

## parametric example
learnQ <- formula(Y~I(as.integer(A)):(U+V)+I(as.integer(1-A)):(U+V))
ATE.param <- tsml.cara.rct(what="ATE",
                           flavor="parametric",
                           ninit=200,
                           by=100,
                           nmax=400,
                           tm.init=oneOne,
                           tm.ref=oneOne,
                           learnQ=learnQ,
                           tm.model=tm.model,
                           conf.level=0.95,
                           piV=c(1/2, 1/3, 1/6),
                           family="gamma",
                           Qbar=Qbar1,
                           Vbar=Vbar1)
ATE.param
## Not run:
plot(ATE.param, truth=truth)
## End(**Not run**)

## See the vignette for more examples...

achambaz/tsml.cara.rct documentation built on May 10, 2019, 5:10 a.m.