print.xbal: Printing xBalance Objects

Description Usage Arguments Value See Also Examples

View source: R/print.xbal.R

Description

A print method for xBalance objects.

Usage

1
2
3
4
5
6
7
## 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 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.

See Also

xBalance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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.
## 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().

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")

RItools documentation built on June 20, 2018, 1:04 a.m.