Before the performance of the test, some basic commands are needed. With the
source command the codes "ad.r" (for the computation of the Anderson–Darling
type test statistic), "t2p.r" (for the computation of the p-value) and "ad_perm.r" (for
the application of the permutation test) are loaded. With the read.csv instruction the
dataset is imported from the file wine.csv and stored in variable wine. In the dataset
the first 237 rows must correspond to the observations of the first sample (males)
and the remaining 149 to the observation of the second sample (females). Then the
first column of the dataset denotes the sample: hence the label must be 1 for the first
237 rows and 2 for the others. The p-value is less than 0.0001 and the null hypothesis
should be rejected in favor of the alternative hypothesis that the evaluation of males
tends to be better than that of females.
Let us consider another example related to a survey about habits and behaviors of
students at the University of Ferrara in Italy. Two samples of students, (1) enrolled for
the first year and (2) other students, were asked how often they attend the university
facilities (classrooms, libraries, etc.). The goal is to test whether the students enrolled
for the first year in the university system tend to attend the facilities more often than
other students at the significance level