Performs pairwise comparisons of multivariate mean vectors of factor levels, overall or nested. The tests are run in the same spirt of summary.manova(), based on multivariate statistics such as Pillai's trace and Wilks' lambda, which can be applied to test multivariate contrasts.

mvpaircomp(model, factor1, nesting.factor = NULL, 
   test = "Pillai", adjust = "none", SSPerror = NULL, DFerror = NULL) 

# S3 method for mvpaircomp
print(x, ...)

Arguments

model

a multivariate analysis of variance (MANOVA) model, fitted using lm() or manova(); an object of class "mlm".

factor1

a character string indicating a factor declared in the model, whose levels will be compared in pairs.

nesting.factor

optional; a character string indicating a factor also declared in model whose levels will nest the contrasts performed with factor1. factor1 and nesting.factor can have pretty much any form or relationship, that is, not necessarily nested one another.

test

a character string indicating the type of multivariate statistics to be calculated to perform the F-test approximation. Default is "Pillai". Other options are: "Wilks", "Hotelling-Lawley" and "Roy". But they use to give very close results.

adjust

a character string indicating the p-value adjustment method for multiple comparisons. Default is "none". See p.adjust

SSPerror

optional; a numeric matrix representing the residual sum of squares and cross-products, to be used to compute the multivariate statistics.

DFerror

optional; a numeric value representing the residual degrees of freedom, to be used to compute the multivariate statistics.

x

an object of class mvpaircomp.

...

further arguments.

Value

An object of class mvpaircomp, a list of

st

an array containing the summary of the multivariate tests.

SSPcontrast

an array containing p-dimensional square matrices of sum of squares and cross-products of the contrasts.

adjust

a character string indicating the p-value adjustment method used.

fac1

a character string indicating the factor being tested.

fac2

a character string indicating the nesting factor.

References

Krzanowski, W. J. (1988) Principles of Multivariate Analysis. A User's Perspective. Oxford.

Author

Anderson Rodrigo da Silva <anderson.agro@hotmail.com>

See also

Examples

# Example 1 data(maize) M <- lm(cbind(NKPR, ED, CD, PH) ~ family + env, data = maize) anova(M) # MANOVA table
#> Analysis of Variance Table #> #> Df Pillai approx F num Df den Df Pr(>F) #> (Intercept) 1 0.99948 4303.1 4 9 9.375e-15 *** #> family 4 2.26992 3.9 16 48 0.0001151 *** #> env 3 1.69631 3.6 12 33 0.0018017 ** #> Residuals 12 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mvpaircomp(M, factor1 = "family", adjust = "bonferroni")
#> #> Multivariate Pairwise Comparisons #> #> Pillai approx F num DF den DF Pr(>F) #> 1 - 2 0.83217 11.1564 4 9 0.0154218 * #> 1 - 3 0.88819 17.8743 4 9 0.0026108 ** #> 1 - 4 0.56683 2.9442 4 9 0.8227952 #> 1 - 5 0.43243 1.7142 4 9 1.0000000 #> 2 - 3 0.81643 10.0070 4 9 0.0227391 * #> 2 - 4 0.78310 8.1233 4 9 0.0466348 * #> 2 - 5 0.86794 14.7877 4 9 0.0054222 ** #> 3 - 4 0.86242 14.1036 4 9 0.0064871 ** #> 3 - 5 0.91546 24.3634 4 9 0.0007605 *** #> 4 - 5 0.47649 2.0479 4 9 1.0000000 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> With bonferroni p-value adjustment for multiple comparisons
# Example 2 (with nesting factor) # Data on producing plastic film from Krzanowski (1998, p. 381) tear <- c(6.5, 6.2, 5.8, 6.5, 6.5, 6.9, 7.2, 6.9, 6.1, 6.3, 6.7, 6.6, 7.2, 7.1, 6.8, 7.1, 7.0, 7.2, 7.5, 7.6) gloss <- c(9.5, 9.9, 9.6, 9.6, 9.2, 9.1, 10.0, 9.9, 9.5, 9.4, 9.1, 9.3, 8.3, 8.4, 8.5, 9.2, 8.8, 9.7, 10.1, 9.2) opacity <- c(4.4, 6.4, 3.0, 4.1, 0.8, 5.7, 2.0, 3.9, 1.9, 5.7, 2.8, 4.1, 3.8, 1.6, 3.4, 8.4, 5.2, 6.9, 2.7, 1.9) Y <- cbind(tear, gloss, opacity) rate <- gl(2, 10, labels = c("Low", "High")) additive <- gl(2, 5, length = 20, labels = c("Low", "High")) fit <- manova(Y ~ rate * additive) summary(fit, test = "Wilks") # MANOVA table
#> Df Wilks approx F num Df den Df Pr(>F) #> rate 1 0.38186 7.5543 3 14 0.003034 ** #> additive 1 0.52303 4.2556 3 14 0.024745 * #> rate:additive 1 0.77711 1.3385 3 14 0.301782 #> Residuals 16 #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mvpaircomp(fit, factor1 = "rate", nesting.factor = "additive", test = "Wilks")
#> #> Multivariate Pairwise Comparisons #> #> --- #> Comparing levels of rate nested in additive #> #> $Low #> Wilks approx F num DF den DF Pr(>F) #> Low - High 0.46273 5.4184 3 14 0.011 * #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> $High #> Wilks approx F num DF den DF Pr(>F) #> Low - High 0.57322 3.4744 3 14 0.04503 * #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> With none p-value adjustment for multiple comparisons
mvpaircomp(fit, factor1 = "additive", nesting.factor = "rate", test = "Wilks")
#> #> Multivariate Pairwise Comparisons #> #> --- #> Comparing levels of additive nested in rate #> #> $Low #> Wilks approx F num DF den DF Pr(>F) #> Low - High 0.81338 1.0707 3 14 0.3931 #> #> $High #> Wilks approx F num DF den DF Pr(>F) #> Low - High 0.50779 4.5234 3 14 0.02037 * #> --- #> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 #> #> With none p-value adjustment for multiple comparisons
# End (not run)