# NOT RUN {
#Power when 50 subjects are in each group,
#the standard deviation is 4 in each group,
#the average treatment effect is 2,
#there are 10 covariates,
#covariates are moderately related with outcomes,
#and the acceptance probability is 0.01.
power.rerand(N1 = 50, N0 = 50,
s1 = 4, s0 = 4, tau = 2,
K = 10, pa = 0.01, R2 = 0.3)
#same as before, but when
#the average treatment effect is 0.8.
power.rerand(N1 = 50, N0 = 50,
s1 = 4, s0 = 4, tau = 0.8,
K = 10, pa = 0.01, R2 = 0.3)
#The same examples as above,
#but now with treatment effect heterogeneity.
#We set the standard deviation of treatment effects
#to be that of potential outcomes.
#Note that, compared to the previous examples,
#power increases for large treatment effects but
#decreases for small treatment effects.
#This phenomenon is discussed in Branson, Li, and Ding (2022).
power.rerand(N1 = 50, N0 = 50,
s1 = 4, s0 = 4, s.tau = 4, tau = 2,
K = 10, pa = 0.01, R2 = 0.3)
#same as before, but when
#the average treatment effect is 0.8.
power.rerand(N1 = 50, N0 = 50,
s1 = 4, s0 = 4, s.tau = 4, tau = 0.8,
K = 10, pa = 0.01, R2 = 0.3)
# }
Run the code above in your browser using DataLab