| Title: | Rank-Based Tests for Multivariate Data in Nonparametric Factorial Designs |
|---|---|
| Description: | Implemented are an ANOVA-type test statistic for testing hypotheses formulated in Mann-Whitney-type effects in nonparametric factorial designs. Statistical inference is based on a wild or a sample-specific bootstrap approach as described in 'Dobler et al. (2019) <doi:10.1007/s10463-019-00717-3>'. The unweighted treatment effects considered do not depend on sample sizes and allow for transitive ordering. The package thus provides an extension of the univariate 'rankFD' package to multivariate data. |
| Authors: | Sarah Friedrich [aut, cre], Dennis Dobler [aut], Markus Pauly [aut] |
| Maintainer: | Sarah Friedrich <[email protected]> |
| License: | GPL-2 | GPL-3 |
| Version: | 0.1.1 |
| Built: | 2026-10-13 11:32:31 UTC |
| Source: | https://github.com/smn74/rankmanova |
A dataset containing information on the annual household income along with 13 other demographic factors of shopping mall customers in the San Francisco Bay Area.
data(marketing)data(marketing)
A data frame with 8993 rows and 14 variables:
ANNUAL INCOME OF HOUSEHOLD (PERSONAL INCOME IF SINGLE)
Sex, 1= male, 2 = female
Marital status
Age (categorized)
Education: 1. Grade 8 or less 2. Grades 9 to 11 3. Graduated high school 4. 1 to 3 years of college 5. College graduate 6. Grad Study
Occupation
HOW LONG HAVE YOU LIVED IN THE SAN FRAN./OAKLAND/SAN JOSE AREA?
DUAL INCOMES (IF MARRIED)
PERSONS IN YOUR HOUSEHOLD
PERSONS IN HOUSEHOLD UNDER 18
HOUSEHOLDER STATUS
TYPE OF HOME
ETHNIC CLASSIFICATION
WHAT LANGUAGE IS SPOKEN MOST OFTEN IN YOUR HOME? 1. English 2. Spanish 3. Other
Impact Resources, Inc., Columbus, OH (1987). Dataset available from https://hastie.su.domains/ElemStatLearn/data.html, formerly part of the ElemStatLearn package.
Pairwise post-hoc comparisons in nonparametric multivariate factorial designs
pairwise(object, type = NULL, base = 1, factor = NULL, uni = FALSE, ...)pairwise(object, type = NULL, base = 1, factor = NULL, uni = FALSE, ...)
object |
A |
type |
The type of the pairwise comparison must be specified here. Calculation is based on the contrMat function in package multcomp, see the corresponding help page for details on the types of contrasts available. |
base |
An integer specifying which group is considered the baseline group
for Dunnett contrasts, see |
factor |
If desired, the specific factor for which the calculations shall be computed. Defaults to all factors present in the model (without interactions, though). |
uni |
Logical: should univariate comparisons also be computed? Default is FALSE. |
... |
Not used yet. |
The pairwise function computes p-values for pairwise comparisons as provided by
contrMat. For the nonparametric comparisons,
only Tukey's all-pairwise and Dunnett's many-to-one comparisons are used.
Note that due to the formulation of our effect size vectors, these tests can be performed by applying
the closed testing principle, i.e., no alpha-correction is needed, see Dobler, Friedrich and Pauly (2019)
for details.
NOTE: If an interaction is significant in the main model, the data set should be split accordingly for the post-hoc analyses. Thus, the pairwise comparisons are not computed for interaction effects.
p-values for the multivariate and (if desired) univariate pairwise comparisons of the chosen factor.
Dobler, D., Friedrich, S., and Pauly, M. (2019). Nonparametric MANOVA in meaningful effects. Annals of the Institute of Statistical Mathematics.
Returns a short summary of the results (test statistic with p-values)
## S3 method for class 'rankMANOVA' print(x, ...)## S3 method for class 'rankMANOVA' print(x, ...)
x |
A rankMANOVA object |
... |
Additional parameters (currently not used) |
No return value, print()-function
The rankMANOVA function calculates an ANOVA-type statistic (ATS) with (wild) bootstrap p-values for nonparametric factorial designs with multivariate data.
rankMANOVA( formula, data, iter = 10000, alpha = 0.05, para = FALSE, CPU, dec = 3, seed = NULL, resampling = "bootstrap", nested.levels.unique = FALSE )rankMANOVA( formula, data, iter = 10000, alpha = 0.05, para = FALSE, CPU, dec = 3, seed = NULL, resampling = "bootstrap", nested.levels.unique = FALSE )
formula |
A model |
data |
A data.frame containing the variables in
|
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. |
para |
Logical: should parallel computing be used? Default is FALSE. |
CPU |
The number of cores used for parallel computing. If omitted, cores are
detected via |
dec |
Number of decimals the results should be rounded to. Default is 3. |
seed |
A random seed for the resampling procedure. If omitted, no reproducible seed is set. |
resampling |
The resampling method to be used, one of "bootstrap" (sample-specific bootstrap approach) and "WildBS" (wild bootstrap approach with Rademacher weights). The default is "WildBS". |
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. |
Implemented is an ANOVA-type test statistic for testing hypotheses formulated in Mann-Whitney-type
effects in nonparametric factorial designs. Statistical inference is based on a wild or a sample-specific
bootstrap approach. The unweighted treatment effects considered do not depend on sample sizes and allow for
transitive ordering. The package thus provides an extension of the univariate rankFD
package to multivariate data.
A rankMANOVA 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 unweighted treatment effects for each dimension. |
Test |
The test statistic(s) and p-value(s) based on the chosen bootstrap approach. |
The number of bootstrap iterations has been set to 100 in the examples due to runtime restrictions on CRAN. Usually it is recommended to use at least 1000 iterations.
Dobler, D., Friedrich, S., and Pauly, M. (2017). Nonparametric MANOVA in Mann-Whitney effects.
data("marketing") mymar <- marketing[, c("Sex", "Income", "Edu")] mymar2 <- na.omit(mymar) test <- rankMANOVA(cbind(Income, Edu) ~ Sex, data = mymar2, iter=100, resampling = "WildBS", CPU = 1) summary(test)data("marketing") mymar <- marketing[, c("Sex", "Income", "Edu")] mymar2 <- na.omit(mymar) test <- rankMANOVA(cbind(Income, Edu) ~ Sex, data = mymar2, iter=100, resampling = "WildBS", CPU = 1) summary(test)
Returns a summary of the results including sample sizes and unweighted treatment effects for all groups as well as the test statistic with resampling-based p-values
## S3 method for class 'rankMANOVA' summary(object, ...)## S3 method for class 'rankMANOVA' summary(object, ...)
object |
A rankMANOVA object |
... |
Additional parameters (currently not used) |
No return value, summary()-function
Univariate post-hoc comparisons in nonparametric multivariate factorial designs
univariate(object, factor = NULL, data, ...)univariate(object, factor = NULL, data, ...)
object |
A |
factor |
The factor for which univariate comparisons are desired. Must be one of the factors used in the main analysis, of course. Defaults to all factors in the model (without interactions). |
data |
The data set to be used for the analysis. If none is specified, the data used for fitting
|
... |
Not used yet. |
The univariate function computes p-values for univariate comparisons. If no factor is specified, all factors in the model are used. In this case, the unweighted effects don't change compared to the multivariate model and are thus not returned, only p-values and test statistics for the univariate tests. Details on the tests can be found in Dobler, Friedrich and Pauly (2019). Note that due to the formulation of our effect size vectors, these tests can be performed by applying the closed testing principle, i.e., no alpha-correction is needed.
NOTE: If an interaction is significant in the main model, the data set should be split accordingly for the post-hoc analyses. Thus, the univariate comparisons are not computed for interaction effects.
p-values for the univariate post-hoc comparisons of the chosen factor.
Dobler, D., Friedrich, S., and Pauly, M. (2019). Nonparametric MANOVA in meaningful effects. Annals of the Institute of Statistical Mathematics.