stremr
stremr copied to clipboard
sequential randomization
The trial is a sequentially randomized trial with possible re-randomization based on previous response. At baseline, participants are randomized 1:1:1 into three arms, texting intervention, mobile app intervention, and standard of care. At 3 month increments participants in the text and app arms who do not "improve" their risk behaviors are eligible for re-randomization into a third intervention, e-coaching.
Because it's a randomized trial, at each time I know the probability of receiving each treatment given the past. I don't necessarily have to input the known probabilities, but I can't figure out how to properly stratify the fitPropensity
command and can't digest what the error messages are actually telling me.
Attached is an example data table.
-
ID
=partic. id
-
covariate
= a binary baseline covariate -
Y
= the outcome at month 12 -
txt
= on the texting intervention -
app
= on the app intervention -
t
= time (0 = baseline, 3, 6, 9, 12 months) -
monitor
= whether they are seen at t + 3 -
risk
= risk behavior score, if risk at t+3 is bigger than or equal to risk at t (and risk at t != 0) and - -
txt == 1 | app == 1
, then they are eligible at t+3 for rerandomizaiton to e-coaching.Y
is the sum of risk at 3, 6, 9, and 12. -
trt
= multinomial treatment indicator 1 = txt, 2 = app -
Y_scale
= Y scaled by maximum value of Y -
trt.setXX
= treatment levels for rules I'm interested in (no int, all txt int, all app int, txt + e-coaching when risk doesn't improve, app + e-coaching when risk doesn't improve) -
eligible
= whether or not someone is eligible for re-randomization at t -
ecoach
= on the e-coach intervention -
coach.tminus1
= on e-coach intervention at previous time point -
cens
= censoring = 0 for everyone, since it seemed like providing monitoring status made stremr happier than censoring + missing values
Here's what I've tried:
gform_MONITOR <- "monitor ~ risk + covariate"
# would perhaps prefer this to be intercept only, but ~1 syntax seems to piss everything off
gform_TRT <- "trt ~ risk"
stratify_TRT <- list(trt = c(
"t == 0", # baseline randomization prob.
"t == 3 & eligible == 1", # at time 3 prob. of getting e-coaching amongst those eligible (should be 1/2)
"t == 6 & eligible == 1", # at time 6 prob. of getting e-coaching amongst those eligible (should be 1/2)
"t == 9 & eligible == 1", # at time 9, etc...
"t == 3 & txt == 1 & eligible == 0", # at time 3, txt folks should stay on txt with prob. 1 if not eligible for e-coach
"t == 6 & txt == 1 & eligible == 0", # at time 6, txt folks should stay on txt with prob. 1 if not eligible for e-coach
"t == 9 & txt == 1 & eligible == 0", # etc...
"t == 3 & app == 1 & eligible == 0", # ditto app people who are not eligible
"t == 6 & app == 1 & eligible == 0", # etc
"t == 9 & app == 1 & eligible == 0", # etc
"t == 3 & app == 0 & txt == 0", # ditto standard of care people, i.e. trt == 0
"t == 6 & app == 0 & txt == 0", # etc
"t == 9 & app == 0 & txt == 0", # etc
"t == 6 & ecoach.tminus1 == 1", # once you get to e-coaching, you stay on e-coaching with prob. 1
"t == 9 & ecoach.tminus1 == 1"))
I'm just wondering how to properly specify these regressions and whether there is a way to make them intercept only or not.