Learn R Programming

PMCMR (version 4.3)

get.pvalues: Prints PMCMR objects

Description

Returns a vector of pvalues that includes the names of the pairwise groups (i.e. the null hypothesis). The output can be used by multcompLetters to find homogeneous groups.

Usage

get.pvalues(object, …)

Arguments

object

either an object of class "PMCMR", usually, a result of a call to any of the posthoc-tests included in the package PMCMR. Or an object of class "pairwise.htest", a result of a call to pairwise.prop.test, pairwise.t.test or pairwise.wilcox.test.

further arguments, currently ignored.

Value

out

a named vector with p-values

See Also

multcompLetters, xtable, pairwise.prop.test, pairwise.t.test, pairwise.wilcox.test

Examples

Run this code
# NOT RUN {
data(InsectSprays)
attach(InsectSprays)
out <- posthoc.kruskal.dunn.test(count ~ spray, p.adjust="bonf")
out.p <- get.pvalues(out)
out.p

### a barplot, significant level at p < 0.05
require(multcompView)
out.mcV <- multcompLetters(out.p, threshold=0.05)
Rij <- rank(count)
Rj.mean <- tapply(Rij, spray, mean)
ti <- paste(out$method, "\nP-adjustment method:", out$p.adjust.method)
xx <- barplot(Rj.mean, ylim=c(0, 1.2* max(Rj.mean)),
xlab="Spray", ylab="Mean rank", main=ti)
yy <- Rj.mean + 3
text(xx, yy, lab=out.mcV$Letters)

## table format
dat <- data.frame(Group = names(Rj.mean),
                  meanRj = Rj.mean,
                  M = out.mcV$Letters)
dat

## LaTeX table
require(xtable)
xtable(dat, caption=ti, digits=1)

detach(InsectSprays)
# }

Run the code above in your browser using DataLab