Description Usage Arguments Details See Also Examples
View source: R/plot.xbal.R View source: R/plot.xbal.R
This plotting function summarizes variable by stratification matrices. For
each variable (a row in the x
argument), the values are under each
stratification (the columns of x
) plotted on the same line.
1 2 3 4 5 
x 
A matrix of variables (rows) by strata (columns). 
ordered 
Should the variables be ordered from most to least imbalance on the first statistic? 
segments 
Should lines be drawn between points for each variable? 
colors 
Either a vector or a matrix of shape indicators
suitable to use as a 
shapes 
Either a vector or a matrix of shape indicators
suitable to use as a 
segments.args 
A list of arguments to pass to the

points.args 
A list of arguments to pass to the 
xlab 
The label of the xaxis of the plot. 
xrange 
The range of xaxis. By default, it is 1.25 times the range of 
groups 
A factor that indicates the group of each row in

tiptext 
If you are using the 
include.legend 
Should a legend be included? 
legend.title 
An optional title to attach to the legend. 
... 
Additional arguments to pass to 
It is conventional to standardize the differences to common scale
(e.g. zscores), but this is not required. When ordered
is
set to true, plotting will automatically order the data from
largest imbalance to smallest based on the first column of
x
.
You can fine tune the colors and shapes with the like named
arguments. Any other arguments to the points
function
can be passed in a list as points.args
. Likewise, you can
fine tune the segments between points with segments.args
.
plot.xbal
, xBalance
,
segments
, points
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  set.seed(20121204)
# generate some balance data
nvars < 10
varnames < paste("V", letters[1:nvars])
balance_data < matrix(c(rnorm(n = nvars, mean = 1, sd = 0.5),
rnorm(n = nvars, mean = 0, sd = 0.5)),
ncol = 2)
colnames(balance_data) < c("Before Adjustment", "After Matching")
rownames(balance_data) < varnames
RItools:::balanceplot(balance_data,
colors = c("red", "green"),
xlab = "Balance Before/After Matching")
# base R graphics are allowed
abline(v = colMeans(balance_data), lty = 3, col = "grey")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.