R package for estimating treatment effects in matched-pair cluster randomized trials (MPCR) using covariate calibration

How to install?


Why should someone use mpcr?

  • Estimation of treatment effects in matched-pair cluster randomized (mpcr) trials by calibrating covariate imbalance between clusters. We address estimation of intervention effects in experimental designs in which
    • (a) interventions are assigned at the cluster level;
    • (b) clusters are selected to form pairs, matched on observed characteristics; and
    • (c) intervention is assigned to one cluster at random within each pair. One goal of policy interest is to estimate the average outcome if all clusters in all pairs are assigned control versus if all clusters in all pairs are assigned to intervention. In such designs, inference that ignores individual level covariates can be imprecise because cluster-level assignment can leave substantial imbalance in the covariate distribution between experimental arms within each pair. However, most existing methods that adjust for covariates have estimands that are not of policy interest. We propose a methodology that explicitly balances the observed covariates among clusters in a pair, and retains the original estimand of interest.

How does it compare to other existing solutions?

  • First R implementation of intervention effect estimation under matched-pair cluster randomized design, using baseline covariates for effect estimation consistency and efficiency.

  • Reference is here.

What are the main functions?

  • mpcr function


  • Prepare your dataset

You need to specify treatment arm, cluster number, primary outcome, covariates. Note that suppose there are N pairs, then the first pair of clusters are numbered as 1 and N+1; second pair as 2, N+2, etc.

  • Example code

can be found here


current version does not have Bayes estimates, please specify BAYES_STATUS as FALSE. The Bayesian estimation code is ready. I will update it soon.