Description Usage Arguments Value Author(s) References See Also Examples
Choose the resample size for stage 1 bootstrap using double bootstrap. The form of m is:
m = n^[1+Xi(1-pHat)/(1+Xi)], where the tuning parameter Xi is chosen via double bootstrap and pHat is the estimated non-regularity level computed by getModel
. Example could be found under qLearn
.
1 2 3 | chooseMDoubleBootstrap(s2Formula,s1Formula,
completeData,s2Treat,interact,s2Indicator,alpha=0.05,
boot1Num=500,boot2Num=500,...)
|
s2Formula |
stage 2 regression formula |
s1Formula |
Stage 1 regression formula |
completeData |
data frame containing all the variables |
s2Treat |
character string: name of the stage 2 treatment variable |
interact |
character vector: names of variables that interact with s2Treat |
s2Indicator |
character string: names of the stage 2 treatment indicator variable |
alpha |
level of significance |
boot1Num |
numbers of bootstrap sampling for first order bootstrap |
boot2Num |
numbers of bootstrap sampling for second order bootstrap |
... |
other arguments of the |
m |
resample size for stage 1 bootstrap |
Jingyi Xin jx2167@columbia.edu, Bibhas Chakraborty bc2425@columbia.edu, and Eric B.Laber eblaber@ncsu.edu
Chakraborty, B., and Laber, E.B. (2012). Inference for Optimal Dynamic Treatment Regimes using an Adaptive m-out-of-n Bootstrap Scheme. Submitted.
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 | set.seed(100)
# Simple Simulation on 1000 subjects
sim<-matrix(0,nrow=1000,ncol=7)
colnames(sim)<-c("H1","A1","Y1","H2","A2","Y2","IS2")
sim<-as.data.frame(sim)
# Randomly generate stage 1 covariates and stage 1 and 2 treatments
sim[,c("H1","A1","A2")]<-2*rbinom(1000*3,1,0.5)-1
# Generate stage 2 covariates based on H1 and T1
expit<-exp(0.5*sim$H1+0.5*sim$A1)/(1+exp(0.5*sim$H1+0.5*sim$A1))
sim$H2<-2*rbinom(1000,1,expit)-1
# Assume stage 1 outcome Y1 is 0
# Generate stage 2 outcome Y2
sim$Y2<-0.5*sim$A2+0.5*sim$A2*sim$A1-0.5*sim$A1+rnorm(1000)
# Randomly assign 500 subjects to S2
sim[sample(1000,500),"IS2"]<-1
sim[sim$IS2==0,c("A2","Y2")]<-NA
# Define models for both stages
s2Formula<-Y2~H1*A1+A1*A2+A2:H2
s1Formula<-Y1~H1*A1
# Use boot1Num=boot2Num=20 in the example to save computational time
# In real case should use greater number
m<-chooseMDoubleBootstrap(s2Formula,s1Formula,sim,s2Treat="A2",
interact=c("A1","H2"),s2Indicator="IS2",boot1Num=20,boot2Num=20)
|
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15
[1] 16
[1] 17
[1] 18
[1] 19
[1] 20
coverage = 0.35
[1] "here2"
[1] 0.05
[1] 851
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15
[1] 16
[1] 17
[1] 18
[1] 19
[1] 20
coverage = 0.7
[1] "here2"
[1] 0.075
[1] 789
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15
[1] 16
[1] 17
[1] 18
[1] 19
[1] 20
coverage = 0.45
[1] "here2"
[1] 0.1
[1] 735
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15
[1] 16
[1] 17
[1] 18
[1] 19
[1] 20
coverage = 0.85
[1] "here2"
[1] 0.125
[1] 686
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15
[1] 16
[1] 17
[1] 18
[1] 19
[1] 20
coverage = 0.8
[1] "here2"
[1] 0.15
[1] 642
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15
[1] 16
[1] 17
[1] 18
[1] 19
[1] 20
coverage = 0.85
[1] "here2"
[1] 0.175
[1] 603
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.