# NOT RUN {
R_t = encouraged_clusters$aggregated_outcome
R_c = control_clusters$aggregated_outcome
d_t = encouraged_clusters$aggregated_treatment
d_c = control_clusters$aggregated_treatment
# Test the pooled effect ratio estimand lambda = 0 using
# the default sample variance estimator, i.e., setting Q = NULL.
res = PER(0, R_t, R_c, d_t, d_c)
# We may leverage observed covariates from both the encouraged
# and control clusters to construct less conservative variance
# estimator. The variance estimator will be less conservative if
# these covariate predict the treated-minus-control difference
# in the outcome. In this illustrated dataset, V1-V10 are simulated
# white noise; it is not surprising that they do not help
# reduce the variance.
Q = cbind(encouraged_clusters[,1:10], control_clusters[,1:10])
res_2 = PER(0, R_t, R_c, d_t, d_c, Q)
# }
Run the code above in your browser using DataLab