data(nuclearplants)
xb1 <- balanceTest(pr ~ date + t1 + t2 + cap + ne + ct + bw + cum.n + strata(pt),
data = nuclearplants)
print(xb1)
print(xb1, show.pvals = TRUE)
print(xb1, horizontal = FALSE)
## The following doesn't work yet.
if (FALSE) print(xb1, which.vars=c("date","t1"),
which.stats=c("adj.means","z.scores","p.values"))
## The following example prints the adjusted means
## labeled as "treatmentvar=0" and "treatmentvar=1" using the
## formula provided to xBalance().
# This is erroring with the change to devtools, FIXME
if (FALSE) print(xb1,
which.vars = c("date", "t1"),
which.stats = c("pr=0", "pr=1", "z", "p"))
## Only printing out a specific stratification factor
xb2 <- balanceTest(pr~ date + t1 + t2 + cap + ne + ct + bw + cum.n + strata(pt),
data = nuclearplants)
print(xb2, which.strata = "pt")
Run the code above in your browser using DataLab