Learn R Programming

twowaytests (version 1.4)

paircompTwoWay: Pairwise Comparisons for Two Way Layout

Description

paircompTwoWay is a generic function for pairwise comparisons by adjusting p-values.

Usage

# S3 method for twt
paircompTwoWay(x, adjust.method = c("bonferroni", "holm", "hochberg", "hommel", "BH", 
  "BY", "fdr", "none"), verbose = TRUE, ...)

Value

Returns a data.frame of output.

Arguments

x

a twt object.

adjust.method

Method for adjusting p values (see p.adjust). Default is set to "bonferroni".

verbose

a logical for printing output to R console.

...

Additional arguments affecting multiple comparisons of groups in two-way independent designs.

Author

Muhammed Ali Yilmaz, Osman Dag

Details

The paircompTwoWay function makes pairwise comparisons depending on significance of interaction term. It calculates p-values with corresponding same test if the interaction term is not statistically significant. Otherwise, it calculates p-values with st.test after two-way ANOVA, wt.test after two-way ANOVA under heteroscedasticity and mw.test after other tests. Then, it adjusts p-values with p.adjust.

Examples

Run this code

library(twowaytests)
data(alveolar)

out <- aovTwoWay(cell ~ ovalbumin*treatment, data = alveolar)
paircompTwoWay(out)

out <- aovTwoWay(cell ~ treatment*ovalbumin, data = alveolar)
paircompTwoWay(out)

out <- aovTwoWay(cell ~ ovalbumin*treatment, data = alveolar, alpha = 0.10)
paircompTwoWay(out)

out <- aovTwoWay(cell ~ treatment*ovalbumin, data = alveolar, alpha = 0.10)
paircompTwoWay(out)
paircompTwoWay(out, adjust.method = "hochberg")

Run the code above in your browser using DataLab