Learn R Programming

RItools (version 0.1-13)

print.xbal: 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" which is 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 arguements. Not currently used.

Value

  • [object Object],[object Object]

See Also

xBalance

Examples

Run this code
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("all"))

str(xb1)

print(xb1)

print(xb1, show.pvals = TRUE)

print(xb1, horizontal = FALSE)

## The following doesn't work yet.
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("all"))

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

Run the code above in your browser using DataLab