print.xbal | R Documentation |
A print
method for balance test objects produced by xBalance
and balanceTest
.
## S3 method for class 'xbal'
print(
x,
which.strata = dimnames(x$results)[["strata"]],
which.stats = dimnames(x$results)[["stat"]],
which.vars = dimnames(x$results)[["vars"]],
print.overall = TRUE,
digits = NULL,
printme = TRUE,
show.signif.stars = getOption("show.signif.stars"),
show.pvals = !show.signif.stars,
horizontal = TRUE,
report = NULL,
...
)
x |
An object of class "xbal" which is the result of a call
to |
which.strata |
The stratification candidates to include in the printout. Default is all. |
which.stats |
The test statistics to include. Default is all
those requested from the call to |
which.vars |
The variables for which test information should be displayed. Default is all. |
print.overall |
Should the omnibus test be reported? Default
is |
digits |
To how many digits should the results be displayed?
Default is |
printme |
Print the table to the console? Default is
|
show.signif.stars |
Use stars to indicate z-statistics larger
than conventional thresholds. Default is |
show.pvals |
Instead of stars, use p-values to summarize the
information in the z-statistics. Default is |
horizontal |
Display the results for different candidate
stratifications side-by-side (Default, |
report |
What to report. |
... |
Other arguements. Not currently used. |
The formatted table of variable-by-variable statistics for each stratification.
If the overall Chi-squared statistic is requested, a formatted version of that table is returned.
xBalance
, balanceTest
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.
## Not run: print(xb1, which.vars=c("date","t1"),
which.stats=c("adj.means","z.scores","p.values"))
## End(Not run)
## 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
## Not run: print(xb1,
which.vars = c("date", "t1"),
which.stats = c("pr=0", "pr=1", "z", "p"))
## End(Not run)
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.