print.xbal {RItools}R Documentation

Printing xBalance Objects

Description

A print method for xBalance objects.

Usage

## 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,...)

Arguments

x An object of class "xbal" — the result of a call to xBalance()
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 xBalance.
which.vars The variables for which test information should be displayed. Default is all.
print.overall Should the omnibus test be reported? Default is TRUE.
digits To how many digits should the results be displayed? Default is max(2,getOptions("digits")-4).
printme Print the table to the console? Default is TRUE
show.signif.stars Use stars to indicate z-statistics larger than conventional thresholds. Default is TRUE.
show.pvals Instead of stars, use p-values to summarize the information in the z-statistics. Default is FALSE
horizontal Display the results for different candidate stratifications side-by-side (Default, TRUE), or as a list for each stratification (FALSE).
... Other arguments. Not currently used.

Value

vartable The formatted table of variable-by-variable statistics for each stratification.
overalltable If the overall Chi-squared statistic is requested, a formatted version of that table is returned.

References

xBalance

Examples

data(nuclearplants)

xb0<-xBalance(pr~ date + t1 + t2 + cap + ne + ct + bw + cum.n,data=nuclearplants)

print(xb0)

xb1<-xBalance(pr~ date + t1 + t2 + cap + ne + ct + bw + cum.n,
         strata=data.frame(unstrat=factor(character(32)),
           pt=factor(nuclearplants$pt)),
         data=nuclearplants,
         report=c("adj.means","adj.mean.diffs","std.diffs", "z.scores", "chisquare.test","p.values"))

str(xb1)

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"))
##The following example prints the adjusted means --- labeled as "treatmentvar=0" and "treatmentvar=1" using the formula provided to xBalance().
print(xb1,which.vars=c("date","t1"),which.stats=c("pr=0","pr=1","z","p"))
##Now, not asking for the omnibus test
xb2<-xBalance(pr~ date + t1 + t2 + cap + ne + ct + bw + cum.n,
         strata=data.frame(unstrat=factor(character(32)),
           pt=factor(nuclearplants$pt)),
         data=nuclearplants,
         report=c("adj.means","adj.mean.diffs","std.diffs", "z.scores", "p.values"))

print(xb2,which.strata="pt")


[Package RItools version 0.1-5 Index]