Website for
Stochastic Ordering and ANOVA:
Theory and Applications with
by
Basso
D., Pesarin F., Salmaso L., Solari A.
This website contains the source of the R
functions which are included in each chapter’s final section. Online
helps are available just for some functions of the first chapter and should be
considered as examples of how to build a permutation test for some basic
problems. Please refer to the examples in the book for information on how to
use the other functions. The functions are listed according to chapter order.
To download the codes, just rightclick on the related link and choose the save
as option from the menu. Some functions require the basic functions combine.r and t2p.r. To load a function in the
R environment, save it within your working directory and type:
source(“path/name_function.r”)
These codes are provided with absolutely no
guarantee. Each chapter’s R code is available as well. For any
problem/suggestion, do not hesitate to contact us.
R
functions:
1: Permutation
Tests
These functions are useful to run a
multivariate permutation test through the Nonparametric Combination
methodology (NPC).
 combine.r :
performs the nonparametric
combination of dependent tests with some combining functions and restricted
alternatives; (help)
 t2p.r :
obtains a matrix of pvalue from a given matrix containing the (multivariate)
permutation distribution of the test statistics; (help)

permute.r :
returns the
(multivariate) permutation distribution of tests statistics which can be
obtained by a linear combination of data; (help)
 ptest2s.r :
performs multivariate twosample permutation tests for continuous data based on
Student's t statistics;
 clostest.r :
computes multiplicity adjusted pvalues by using the closed testing procedure;
 stepdown.r :
computes multiplicity adjusted pvalues by using the stepdown procedure;

studT.r :
Student's t test statistic;

Westdata.r :
dataset;
2: Ordinal
Data
 Dchisq.r :
performs the directed chisquared test;
 LRT.r :
performs the order restricted likelihood ratio test;
 ptestRs.r :
combined test for comparing R>2 independent samples based on univariate
data;
 ptest2s.r :
performs multivariate twosample permutation tests for continuous data based on
Student's t statistics;

studt.r :
Student's t test statistic;

Tmax.r :
for ordered categorical data, perform the adaptive test based on isotonic
regression;
3: Multivariate
Ordinal Data
 permzh.r :
computes permutationbased marginal tests for twosample multivariate ordinal
data,
and returns the global significance and
the multiplicity adjusted pvalues for endpoints and domains;
 bootzh.r :
computes bootstrapbased marginal tests for twosample multivariate ordinal
data,
and returns the global significance and
the multiplicity adjusted pvalues for endpoints and domains;
4: Multivariate
Continuous Data
 ptest2s.r :
performs multivariate twosample permutation tests for continuous data based on
Student's t statistics;
 pstocrs.r :
performs the Rsample combined permutation tests for multivariate stochastically
ordered continuous data;
 rats.Rdata :
dataset;
 example4.Rdata :
dataset;
5: Nonparametric
Oneway ANOVA
These functions are suitable for (univariate)
oneway ANOVA problems with posthoc comparisons. The Umbrella alternative is
also considered.
 aov_perm.r :
permutation test for oneway ANOVA and posthoc comparisons;
 MW.r :
Mack & Wolfe test for umbrella alternatives;
 umbrella.r
:
permutation test for umbrella alternatives;
 umbrella_rep.r :
permutation test for umbrella/trend alternatives with repeated measures;
6: Synchronized
Permutation Tests in Twoway ANOVA
These functions perform constrained/unconstrained permutation
tests for Twoway ANOVA and posthoc comparisons on main effects. A summary of
the results and a graphical representation of the permutation confidence
intervals suggested by Hsu (1996) are also provided.
 CSP.r :
Constrained permutation test;
 USP.r :
Unconstrained permutation test;
 IC_CSP.r :
Obtains CSP confidence intervals for main factor posthoc comparisons;
 IC_USP.r :
Obtains USP confidence intervals for main factor posthoc comparisons;
 plot_hsu.r :
graphical representation for posthoc comparisons
 synchro_summary.r : output summary for CSP/ USP
objects;
7: Permutation
Tests for Unreplicated Factorial Designs
These functions create the design matrix of a full
2^{k} unreplicated factorial design and perform a permutation test on
the greatest 2^{k }1 effects.
 create_design.r :
create the design matrix of a full 2^{k} unreplicated factorial design.
 unreplicated.r :
permutation test for full 2^{k} unreplicated factorial designs.

other
functions and examples
· For info, contact: luigi.salmaso@unipd.it