# NOT RUN {
set.seed(1234)
post = c(rep(0,100), rep(1,100))
tx = c(rep(0, 100), rbinom(n = 100, prob = 0.27, size = 1))
y = rbinom(n = 200, prob = 0.1 + .02 * post - 0.05 * tx, size = 1)
# Two cohorts, full data
scqe.2cohort.full = scqe(post = post, treatment = tx, outcome = y,
delta = seq(from = -0.1, to = 0.1, by = 0.05))
plot(scqe.2cohort.full)
summary(scqe.2cohort.full)
# One cohort, full data
scqe.1cohort.full = scqe(treatment = tx, outcome = y,
delta=seq(from = -0.1, to = 0.1, by = 0.05))
plot(scqe.1cohort.full)
summary(scqe.1cohort.full)
# Two cohorts, summary data only
scqe.2cohort.sum = scqe(untr_pre = 200,untr_post = 150, tr_post = 50,
tr_pre = 0, Y_tr_post = 20, Y_untr_post = 1,
Y_tr_pre = 0, Y_untr_pre = 5, min_delta = 0.1,
max_delta = 1)
plot(scqe.2cohort.sum)
summary(scqe.2cohort.sum)
# One cohort, summary data only
scqe.1cohort.sum = scqe(untr = 100, tr = 200, Y_untr = 5, Y_tr = 50,
min_delta= 0.1, max_delta = 1)
plot(scqe.1cohort.sum)
summary(scqe.1cohort.sum)
# }
Run the code above in your browser using DataLab