Description Usage Arguments Details Author(s) See Also Examples
Split a binary or numeric matrix by a grouping variable, run a series of tests on all variables, adjust for multiple testing and graphically represent results.
1 2 3 4 5 6 7 8 9 10 11  propBarchart(x, g, alpha=0.05, correct="holm", test="prop.test",
sort=FALSE, strip.prefix="", strip.labels=NULL,
which=NULL, byvar=FALSE, ...)
## S4 method for signature 'propBarchart'
summary(object, ...)
groupBWplot(x, g, alpha=0.05, correct="holm", xlab="", col=NULL,
shade=!is.null(shadefun), shadefun=NULL,
strip.prefix="", strip.labels=NULL, which=NULL, byvar=FALSE,
...)

x 
A binary data matrix. 
g 
A factor specifying the groups. 
alpha 
Significance level for test of differences in proportions. 
correct 
Correction method for multiple testing, passed to

test 
Test to use for detecting significant differences in proportions. 
sort 
Logical, sort variables by total sample mean? 
strip.prefix 
Character string prepended to strips of the

strip.labels 
Character vector of labels to use for strips of

which 
Index numbers or names of variables to plot. 
byvar 
If 
... 
Passed on to 
object 
Return value of 
xlab 
A title for the xaxis: see 
col 
Vector of colors for the panels. 
shade 
If 
shadefun 
A function or name of a function to compute which
boxes are shaded, e.g. 
Function propBarchart
splits a binary data matrix into
subgroups, computes the percentage of ones in each column and compares
the proportions in the groups using prop.test
. The
pvalues for all variables are adjusted for multiple testing and a
barchart of group percentages is drawn highlighting variables with
significant differences in proportion. The summary
method can
be used to create a corresponding table for publications.
Function groupBWplot
takes a general numeric matrix, also
splits into subgroups and uses boxes instead of bars. By default
kruskal.test
is used to compute significant differences
in location, in addition the heuristics from
bwplot,kccamethod
can be used. Boxes of the complete sample
are used as reference in the background.
Friedrich Leisch
barplotmethods
,
bwplot,kccamethod
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  ## create a binary matrix from the iris data plus a random noise column
x < apply(iris[,5], 2, function(z) z>median(z))
x < cbind(x, Noise=sample(0:1, 150, replace=TRUE))
## There are significant differences in all 4 original variables, Noise
## has most likely no significant difference (of course the difference
## will be significant in alpha percent of all random samples).
p < propBarchart(x, iris$Species)
p
summary(p)
propBarchart(x, iris$Species, byvar=TRUE)
x < iris[,5]
x < cbind(x, Noise=rnorm(150, mean=3))
groupBWplot(x, iris$Species)
groupBWplot(x, iris$Species, shade=TRUE)
groupBWplot(x, iris$Species, shadefun="medianInside")
groupBWplot(x, iris$Species, shade=TRUE, byvar=TRUE)

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