assg2xBalance {blockTools}R Documentation

Calculate balance statistics from an assignment object


Calculate several balance statistics for experimental units assigned to treatment conditions. Naturally accepts output from the assignment function, and passes it to xBalance from library(RItools). Provides balance summaries for the entire experiment and by group.


assg2xBalance(assg.obj, data, id.var, bal.vars, = "all")



an output object from assignment.


the data frame that was input into block for blocking.


a string specifying the column of data containing identifying information.


a string or vector of strings specifying which column(s) of data contain the variables on which balance is to be checked.

a string or vector of strings passed to xBalance listing the measures to report for each group. See Details for more information.


As of RItools version 0.1-11, must be a subset of c("std.diffs","z.scores","adj.means", "adj.mean.diffs","", "chisquare.test","p.values", "all"). The default, all, returns all measures.


A list of output objects from xBalance. For each group defined in the assignment object, one list element is assigned the name of that group and summarizes the balance in that group according to The last element of the list is named "Overall" and summarizes balance across all groups. The elements of this list are themselves objects of class c("xbal", "list").

If assg.obj has only one group, the first element of the output list is named "Group1", and the second is named "Output". In this case, these two elements will be identical.


Ryan T. Moore


Hansen, Ben B. and Jake Bowers. 2008. "Covariate balance in simple, stratified and clustered comparative studies". Statistical Science 23(2):219–236.

Bowers, Jake and Mark Fredrickson and Ben Hansen. 2010. "RItools:Randomization Inference Tools". R package version 0.1-11.

Moore, Ryan T. 2012. "Multivariate Continuous Blocking to Improve Political Science Experiments". Political Analysis, 20(4):460–479, Autumn.

See Also



b <- block(x100, groups = "g", id.vars = "id", block.vars = c("b1", "b2"))
a <- assignment(b)
axb <- assg2xBalance(a, x100, id.var = "id", bal.vars = c("b1", "b2"))

# axb is a list with 4 elements (one for each of 3 groups, plus one for 'Overall')

[Package blockTools version 0.6.4 Index]