R/covimbal.R

#' @export
covimbal <-
function(y,xmatc) {
   # evaluate covariate imbalance by seeing how well we can predict treatment using linear regression with covariates
   summary(lm(2*y -1 ~ cbind(rep(1,nrow(xmatc)),xmatc) - 1))$r.squared
}

Try the SeqAlloc package in your browser

Any scripts or data that you put into this service are public.

SeqAlloc documentation built on May 2, 2019, 3:14 p.m.