MANOVA: Tests for Multivariate Data in Semi-Parametric Factorial...

View source: R/MANOVA-function.R

MANOVAR Documentation

Tests for Multivariate Data in Semi-Parametric Factorial Designs

Description

The MANOVA function calculates the Wald-type statistic (WTS) and a modified ANOVA-type statistic (MATS) as well as resampling versions of these test statistics for semi-parametric multivariate data.

Usage

MANOVA(
  formula,
  data,
  subject,
  iter = 10000,
  alpha = 0.05,
  resampling = "paramBS",
  para = FALSE,
  CPU,
  seed,
  nested.levels.unique = FALSE,
  dec = 3
)

Arguments

formula

A model formula object. The left hand side contains the response variable and the right hand side contains the factor variables of interest.

data

A data.frame, list or environment containing the variables in formula. Data must be in long format and must not contain missing values.

subject

The column name of the subjects in the data.

iter

The number of iterations used for calculating the resampled statistic. The default option is 10,000.

alpha

A number specifying the significance level; the default is 0.05.

resampling

The resampling method to be used, one of "paramBS" (parametric bootstrap approach) and "WildBS" (wild bootstrap approach with Rademacher weights).

para

If parallel computing should be used. Default is FALSE.

CPU

The number of cores used for parallel computing. If not specified, cores are detected via detectCores.

seed

A random seed for the resampling procedure. If omitted, no reproducible seed is set.

nested.levels.unique

A logical specifying whether the levels of the nested factor(s) are labeled uniquely or not. Default is FALSE, i.e., the levels of the nested factor are the same for each level of the main factor. For an example and more explanations see the GFD package and the corresponding vignette.

dec

Number of decimals the results should be rounded to. Default is 3.

Details

The MANOVA() function provides the Wald-type statistic (WTS) as well as the modified ANOVA-type statistic (MATS) for multivariate designs with metric data as described in Konietschke et al. (2015) and Friedrich and Pauly (2018), respectively. The MATS is invariant under scale transformations of the components and applicable to designs with singular covariance matrices. Both tests are applicable for non-normal error terms, different sample sizes and/or heteroscedastic variances. They are implemented for designs with an arbitrary number of crossed factors or for nested designs. In addition to the asymptotic p-values, the function also provides p-values based on resampling approaches.

Value

A MANOVA object containing the following components:

Descriptive

Some descriptive statistics of the data for all factor level combinations. Displayed are the number of individuals per factor level combination and the vector of means (one column per dimension).

Covariance

The estimated covariance matrix.

WTS

The value of the WTS along with degrees of freedom of the central chi-square distribution and p-value.

MATS

The value of the MATS.

resampling

p-values for the test statistic based on the chosen resampling approach.

NOTE

The number of resampling iterations has been set to 10 in the examples due to run time restrictions on CRAN. Usually it is recommended to use at least 1000 iterations. For more information and detailed examples also refer to the package vignette.

References

Friedrich, S., Konietschke, F., and Pauly, M. (2019). Resampling-Based Analysis of Multivariate Data and Repeated Measures Designs with the R Package MANOVA.RM. The R Journal, 11(2), 380-400.

Konietschke, F., Bathke, A. C., Harrar, S. W. and Pauly, M. (2015). Parametric and nonparametric bootstrap methods for general MANOVA. Journal of Multivariate Analysis, 140, 291-301.

Friedrich, S., Brunner, E. and Pauly, M. (2017). Permuting longitudinal data in spite of the dependencies. Journal of Multivariate Analysis, 153, 255-265.

Bathke, A., Friedrich, S., Konietschke, F., Pauly, M., Staffen, W., Strobl, N. and Hoeller, Y. (2018). Testing Mean Differences among Groups: Multivariate and Repeated Measures Analysis with Minimal Assumptions. Multivariate Behavioral Research, 53(3), 348-359, Doi: 10.1080/00273171.2018.1446320.

Friedrich, S., Konietschke, F., Pauly, M. (2017). GFD - An R-package for the Analysis of General Factorial Designs. Journal of Statistical Software, 79(1), 1-18.

Friedrich, S., and Pauly, M. (2018). MATS: Inference for potentially singular and heteroscedastic MANOVA. Journal of Multivariate Analysis, 165, 166-179.

See Also

RM

Examples

data(EEG)
EEG_mod <- MANOVA(resp ~ sex * diagnosis, 
                    data = EEG, subject = "id", resampling = "paramBS", 
                    alpha = 0.05, iter = 10)
summary(EEG_mod)


smn74/MANOVA.RM documentation built on Aug. 30, 2023, 12:01 a.m.