A unified approach to permutation testing for equivalence

The notion of testing for equivalence of two treatments is widely used in clinical trials, pharmaceutical experiments, bioequivalence and quality control. It is traditionally operated within the intersection–union principle (IU). According to this principle the null hypothesis is stated as the set of effects the differences δ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\delta$$\end{document} of which lie outside a suitable equivalence interval and the alternative as the set of δ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\delta$$\end{document} that lie inside it. In the literature related solutions are essentially based on likelihood techniques, which in turn are rather difficult to deal with. A recently published paper goes beyond most of likelihood limitations by using the IU approach within the permutation theory. One more paper, based on Roy’s union–intersection principle (UI) within the permutation theory, goes beyond some limitations of traditional two-sided tests. Such UI approach, effectively a mirror image of IU, assumes a null hypothesis where δ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\delta$$\end{document} lies inside the equivalence interval and an alternative where it lies outside. Since testing for equivalence can rationally be analyzed by both principles but, as the two differ in terms of the mirror-like roles assigned to the hypotheses under study, they are not strictly comparable. The present paper’s main goal is to look into these problems and provide a sort of comparative analysis of both by highlighting the related requirements, properties, limitations, difficulties, and pitfalls so as to get practitioners properly acquainted with their correct use in practical contexts.


Introduction and motivation
Testing for equivalence (Eq) of two treatments is widely used in clinical trials, pharmaceutical experiments, bioequivalence, quality control, etc. If we take, for example, bioequivalence, a potential risk can arise if the bioequivalence of products is not well regulated and guaranteed. This paper addresses the crucial methodological step in testing for Eq and provides a unified framework to nonparametric testing within the permutation approach.
In the current literature there are two different, albeit dual or mirror-like, approaches for testing for Eq. The first commonly adopted approach, especially in bioequivalence and pharmacostatistics (Anderson-Cook and Borror 2016;Berger 1982;Berger and Hsu 1996;D'Agostino et al. 2003;Hirotsu 2007;Hung and Wang 2009;Lakens 2017;Mehta et al. 1984;Patterson and Jones 2017;Richter and Richter 2002;Wellek 2010), is derived from the intersection-union principle (IU) and its analysis is based mainly on likelihood techniques, which in turn are rather difficult to deal with, or even unavailable outside the regular exponential family (Lehmann 1986). As far as we know, the only paper on IU based on permutation methods is Arboretti et al. (2018). The other approach (Arboretti et al. 2017;Pesarin et al. 2014Pesarin et al. , 2016 is based on Roy's (1953) union-intersection principle (UI), which is also difficult to deal with using likelihood techniques (Sen 2007;Sen and Tsai 1999). The two approaches essentially differ in terms of the roles assigned to the null and alternative hypotheses. In this paper we start with a simple description of both, before introducing the related permutation solutions. We then provide a few sampling inspection plans and an application to a bioequivalence case study (two further case studies are provided in the Supplementary Material). In the final paragraphs, after exploring the limiting behavior of permutation solutions, we discuss the most important requirements and pitfalls of both parametric and nonparametric permutation-based approaches, before drawing our conclusions. The main aim of this paper is to provide the reader with some methodological insights and suggestions in order to make the most suitable choices in relation to Eq testing to deal with any underlying population distribution, any sample sizes and any margins.

On intersection-union and union-intersection approaches
With reference to one endpoint variable X and a two-sample design, to draw inferences on the substantial Eq of a comparative treatment A to a new treatment B, the IU approach consists in checking if the effect d A of A lies in a clinically or biologically or technically unimportant interval around d B of B, i.e. testing the nonequivalence (NEq) null H : ½ðd A d B À e I Þ S ðd A ! d B þ e S Þ versus (V.s) the Eq alternative K : ðd B À e I \d A \d B þ e S Þ; where e I [ 0 and e S [ 0 are the inferior (lower) and superior (upper) margins for the difference d ¼ d A À d B , respectivelymargins that are established by biological, clinical, pharmacological, technical or regulatory arguments and not by purely statistical considerations. Focusing on the multi-aspect nature of the problem, (Berger 1982;Berger and Hsu 1996;Schuirmann 1981Schuirmann , 1987, these hypotheses can be equivalently stated as H H I S H S and K K I T K S , where H I : d À e I ; K I : d [ À e I ; H S : d ! e S ; and K S : d\e S are the partial one-sided sub-hypotheses into which H and K are equivalently broken down. In actual fact, H is true if one and only one of H I and H S is true; K is true when both sub-alternatives K I and K S are jointly true. Accordingly, H is retained if one and only one of two suitable partial test statistics, T I for H I V.s K I and T S for H S V.s K S ; retains the respective sub-null. The alternative K is retained if and only if two sub-alternatives K I and K S are jointly retained. So, the overall (global) solution, T G say, has to be based (Berger 1982;Schuirmann 1981) on a suitable combination of two one-sided tests (TOST).
The UI approach considers the Eq nullH : ðÀe I d e S Þ that d lies inside the Eq interval and the alternative NEq hypothesisK : ½ðd\ À e I Þ S ðd [ e S Þ that d lies outside it. By usingH I : d ! À e I V.sK I : d\ À e I andH S : d e S V.sK S : d [ e S to denote two one-sided sub-hypotheses into which the problem can be broken down, according to Roy (1953) we may equivalently stateH H I TH S and K K I SK S . That is, the nullH is true if both one-sided sub-null hypothesesH I andH S are jointly true andK is true if one and only one of two sub-alternativesK I andK S is true. It is worth noting that UI, having inverted the roles of null and alternative, is effectively a mirrored formulation of IU. Of course, the global UIT G solution implies a suitable combination of two partial test statisticsT I andT S . In Arboretti et al. (2017Arboretti et al. ( , 2018, Pesarin et al. (2016), Sen (2007) and Wellek (2010) it is seen that both combinations of T I and T S for IU andT I andT S for UI are the crucial methodological points at issue for obtaining proper solutions ( Pesarin 2001( Pesarin , 2015( Pesarin , 2016Pesarin and Salmaso 2010;Sen 2007;Sen and Tsai 1999, see also the Supplementary Material).
It is important to highlight that in order to obtain a valid global solution T G , the IU approach requires the researcher to set its maximum type I error rate no larger than a and the maximum type II error rate b no larger than 1 À a; i.e.
where / G is the indicator function for the rejection region of the T G global test and E F ðÁÞ the mean value of ðÁÞ with respect to the underlying data distribution F. Correspondingly, with clear meanings of the symbols, to obtain a valid UI global testT G the researcher must set its maximum type I error rate and maximum type II error rate as: These conditions, that deal with inferential unbiasedness, are necessarily required by any test statistics (Lehmann 1986).
In the literature on the subject matter almost all authors apparently assume that regulatory agencies (e.g. FDA, EMEA, etc.) for testing Eq consider only the IU approach. For instance, the ICH-E9 glossary (Food and Drug Administration 1998) defines Eq of clinical trials as: ''A trial with the primary objective of showing that the response to two or more treatments differs by an amount which is clinically unimportant. That is usually demonstrated by showing that the true treatment difference is likely to lie between a lower and an upper equivalence margin of clinically acceptable differences.'' This definition, however, does not contain sufficiently precise methodological indications as to which of two formulations, the IU (H, K) or the UI ðH;KÞ, is to be chosen, since there are circumstances where one or the other is rationally suitable for the testing problem at hand. We will see that the two share the same asymptotic behavior. This is not the case for finite sample sizes, where quite important differences are ascertained as will be seen in this paper.
Consequently, in any practical situation the researcher must choose which of (H, K) and ðH;KÞ is most suitable for the proper analysis of his/her problem. We think that such an option, although not well emphasized in the literature on hypotheses testing, is common to almost all testing situations. A simple example clarifies this point: let us consider the classic problem of two simple hypotheses: According to the Neyman-Pearson lemma, the best test for where the critical value T a is determined by the distribution of the likelihood ratio under H. On the other hand the best test forH : whereT a is determined by the likelihood ratio distribution underH: So, the duality between two alternative formulations is evident. The researcher is therefore required to explicitly decide between (H, K) and ðH;KÞ; i.e. he/she has to justify which is given the role of null hypothesis, and the maximum rejection rate a when true, so as to strictly control both type I and type II inferential errors with b 1 À a: We believe that no researcher can escape this central necessity. Since both ways are rationally appropriate for Eq testing, such a notion supports our purpose to provide a sort of weak comparative (parallel) analysis of both by highlighting their respective requirements, properties, limitations, difficulties, pitfalls and inferential costs. It has to be stated, however, that two dual formulations reverse the roles of respective inferential risks: what works as type I error for (H, K) has the role, not just the related numerical value, of type II error for (H;K), and vice versa.
Some authors emphasize the general problem that any traditional two-sided consistent test rejects a point null hypothesis with a probability close to one for sufficiently large sample sizes, even for practically negligible violations of the null. For instance, Nunnally (1960) says: ''To minimize type II errors, large samples are recommended. In psychology, practically all null hypotheses are claimed to be false for sufficiently large samples so (...) it is nonsensical to perform an experiment with the sole aim of rejecting the null hypothesis''. According to Pantsulaia and Kintsurashvili (2014) the same concept is expressed by more than 200 authors. Clearly, to go beyond such a limitation of two-sided tests, this suggests considering a null hypothesis as made up of an interval of substantially equivalent points, rather than only one point. As a result the hypotheses for any traditional two-sided testing is written as ðH;KÞ. Such a formulation then has its own specific merits, in spite of the fact that it is not adequately considered in the general literature (Wellek 2010, pp. 355-358, considers some likelihood-based hints). Up to now we have dedicated two papers: Arboretti et al. (2017) to the one-dimensional setting and Pesarin et al. (2016) to the multidimensional setting. It should, however, be emphasized that to find proper workable solutions requires going beyond the limitations of likelihood ratio approaches and so staying within a nonparametric approach, and specifically within the permutation theory and the nonparametric combination (NPC) of dependent permutation tests.
It could be argued that widespread use of the IU approach is due, rather than to rational analysis, to the fact that under a set of very stringent conditions (Lehmann 1986;Romano 2005), one uniformly most powerful unbiased test exists, namely T opt G , and this result is merely extended, by simple analogy, to all Eq problems. It will be seen that such an extension outside those conditions might give rise to several quite severe and intriguing consequences.

Intersection-union and union-intersection permutation tests
Without loss of generality and for the sake of simplicity, we illustrate the proposed methodology with reference to a two-sample design and one-dimensional endpoint variable X. To stay within the permutation theory and the nonparametric combination of dependent permutation tests (NPC), let us assume that a sample of n 1 IID data related to treatment A are drawn from X 1 and, independently, n 2 IID data related to treatment B are drawn from X 2 . This setting can generally be obtained when n 1 units out of n ¼ n 1 þ n 2 are randomly assigned to A and the remaining n 2 to B. We define responses as X 1 ¼ X þ d A and X 2 ¼ X þ d B ; where the underlying variable X, whose distribution is F, is common to both populations. Hence, X 1 ¼ ðX 11 ; . . .; X 1n 1 Þ are the data of sample A and X 2 ¼ ðX 21 ; . . .; X 2n 2 Þ those of sample B. So, the pooled data set is X ¼ ðX 1 ; X 2 Þ ¼ fXðiÞ; i ¼ 1; . . .; n; n 1 ; n 2 g; where in the last notation it is intended that the first n 1 data in the list are from the first sample and the rest from the second. Moreover, we assume that, possibly after suitable data transformations to obtain quasi data symmetry [e.g. as logðÁÞ; ffiffiffiffiffi ffi ðÁÞ p ;RankðÁÞ, etc., also point UI.3 in Sect. 7.3], variable X is provided with a finite mean value, i.e. E F ðjXjÞ\1; so as to use consistent permutation tests based on comparison of sample means (Sen 2007;Pesarin 2015;Pesarin and Salmaso 2013).
It is assumed that two effects d A and d B are fixed and data are homoscedastic. In further research we will extend our permutation theory to random effects, that is to a condition compatible with important forms of heteroscedasticities, as are frequently met in most experimental and observational problems when a treatment, together with the mean, can also modify dispersion or even other aspects of a distribution.
In this context, both IU and UI approaches are in practice worked out by considering two partial tests for each way: one for H I V.s K I and one for H S V.s K S for IU; one forH I V.sK I and one forH S V.sK S for UI.
The two IU partial tests we consider have the (non standardized) form: and correspondingly, the two UI partial tests are: where as usual, X j ¼ P 1 i n j X ji =n j ; j ¼ 1; 2; are sample averages. It is worth noting that T I ¼ ÀT I and T S ¼ ÀT S and that large values of each test are evidence for their respective sub-alternatives. Also worth noting is that IU pair ðT I ; T S Þ, as well as the UI pair ðT I ;T S Þ; are functions of essentially the same data X and so two tests in each pair are negatively dependent (Pesarin 2016;Pesarin et al. 2016).
One major problem related to both IU and UI, that also arises when several test statistics are functions of the same data, is what to do with such a multiplicity of dependent partial tests. In this regard, a meaningful warning by Sen (2007) relating to UI says: ''However, computational and distributional complexities may mar the simple appeal of the UI to a certain extent. (...) The crux of the problem is however to find the distribution theory for the maximum of these possibly correlated statistics. Unfortunately, this distribution depends on the unknown F, even under the null hypothesis. (...) An easy way to eliminate this impasse is to take recourse to the permutation distribution theory (...)''. The same warning applies to the IU.
We partially disagree with this warning. The greatest obstacle to achieving suitable working solutions is finding a general method to cope with the overly complex dependence structure of two partial tests ðT I ; T S Þ for IU and ðT I ;T S Þ for UI. They are negatively dependent and their dependence coefficients depend on underlying F, data X and margins ðe I ; e S Þ. Indeed, such a dependence runs from correlation q ¼ À1, for margins e I ¼ e S ¼ 0, to almost practical independence for sufficiently large margins. Quite a general solution can be validly obtained when it is possible to deal with that dependence nonparametrically.
Moreover, in multidimensional problems, such a dependence is much more complex than pair-wise linear. So it seems impossible to deal with it by proper estimates of all associated dependence coefficients, the number and type of which are typically unknown. Thus, this dependence must be worked out nonparametrically within a well-suited theory. This requires adopting the conditionality principle of inference by conditioning on data X (which under the null are always sufficient), i.e. by the permutation testing principle (Pesarin 2015) and, more importantly, by the NPC of dependent permutation tests (Pesarin 1990(Pesarin , 1992(Pesarin , 2001(Pesarin , 2015(Pesarin , 2016Pesarin and Salmaso 2010, see also the Supplementary Material).
It is worth noting that to stay within the permutation theory, i.e. by permuting the n-dimensional data X, we have to consider permuted data associated with permutations u Ã ¼ ðu Ã 1 ; . . .; u Ã n Þ of unit labels u ¼ ð1; . . .; nÞ. Thus, all test statistics are calculated on corresponding data permutations X Ã ¼ fXðu Ã i Þ; i ¼ 1; . . .; n; n 1 ; n 2 Þ; where two permuted samples are . . .; ng, respectively. Our proposal is to separately test, albeit simultaneously, H I V.s K I and H S V.s K S for IU, andH I V.sK I andH S V.sK S for UI.
To test for H I V.s K I let us consider the statistic T I ¼ X I2 À X I1 ; where the data X 2 of sample B are modified to X I2 ¼ X 2 þ e I while those of sample A are retained as they are, i.e. X I1 ¼ X 1 : Correspondingly, to test for H S V.s K S we use the statistic T S ¼ X S1 À X S2 ; where X S1 ¼ X 1 and X S2 ¼ X 2 À e S . Thus, the global test is by one of their IU-NPC solutions, the simplest and effective of which is: Correspondingly, to test forH I V.sK I andH S V.sK S we use the two statistics and soT G is given by their UI-NPC:T According to the general theory (Lehmann 1986;Romano 2005;Wellek 2010), for T G to be unbiased with the IU-NPC, it is required that conditions a) and b) are both satisfied, thus partial critical values must be calibrated so that the global test T G satisfies a at both extremes of K, that is analogously forT G to be unbiased with the UI-NPC (Arboretti et al. 2018), it is required that conditions ã) andb) are satisfied, thus partial critical values must be calibrated so thatT G satisfies a at both extremes ofH; that is where / h ;/ h , / G ;/ G ; are the indicator functions of rejection regions of concerned tests.
It is worth noting that partial critical values C Ia and C Sa of parametric tests, which depend on distribution F, sample size n and margins ðe I ; e S Þ; according to Lehmann (1986) and Wellek (2010) are to be numerically determined (also UI.3, Sect. 7.1). Essentially, these values can coincide only asymptotically with the standard critical values (e.g. as z a or t a ; etc.) in use with traditional two-sided tests. Thus, in our terminology, they also must be calibrated.
In some literature, the non-calibrated IU-TOST (naive) solution € T G is often considered (e.g. Anderson-Cook and Borror 2016; Berger and Hsu 1996;Lakens 2017;Pardo 2014;Patterson and Jones 2017;Richter and Richter 2002). This solution satisfies condition a) but not b), thus it is far from being unbiased, unless sample sizes and/or margins are sufficiently large (e.g. Sect. 5 and Supplementary Material).
When optimal likelihood solutions T opt G andT opt G are available then for divergent sample sizes, under their conditions, we have T G ! T opt G andT G !T opt G at quite a high rate (Hoeffding 1952).
Computational details and related algorithms are in Arboretti et al. (2018) for the IU-NPC and in Pesarin et al. (2016) for the UI-NPC (see also the Supplementary Material). Of course, by using T ob G ¼ T G ðXÞ andT ob G ðXÞ to denote the observed values of test statistics T G andT G ; respectively, if p value statistics of the IU-NPC then the NEq hypothesis H is rejected at significance level a (the naive IU-TOST € T G rejects H if k T G a; so its true type I error remains unknown, depending on F, data X and margins e I , e S ). Correspond- then the Eq hypothesisH is rejected at significance level a. In practice p value statistics are estimated, at any desired confidence rate, by a conditional Monte Carlo procedure as: where T h stands for T I ; T S ; T G ;T T ;T S ;T G and R is the number of random permutations.

NPC limiting behavior for IU and UI
Let us assume that population mean E F ðXÞ is finite, so that Eð X Ã jXÞ is also finite for almost all sample data X; where X Ã is the sample mean of a without replacement random sample of n 1 or n 2 elements from X; taken as a finite population.
To find the limiting behavior of IU-NPC let us firstly consider the partial test ; where its dependence on effect d is emphasized. In Sen (2007) and Pesarin and Salmaso (2013), based on the law of large numbers for strictly stationary dependent sequences, such as are those generated by the without replacement random sampling (any random permutation is simply a without replacement random sample from X S Þ, it is proved that as minðn 1 ; n 2 Þ ! 1 the permutation distribution of T Ã S ðdÞ weakly converges to E F ð X S1 À X S2 Þ ¼ ðe S À dÞ. Thus, for any d\e S the rejection rate of T S ðdÞ converges to one: E F ð/ T S ; dÞ ! 1. Moreover, for any d [ e S that rejection rate converges to zero. At the right extreme of H S ; d ¼ e S say, since T S ðe S Þ rejects with probability a for any sample sizes (n 1 ; n 2 Þ; its limit rejection rate is also a. The behavior of T I ðdÞ mirrors that of T S ðdÞ. That is, its limiting rejection rate: i) for d ¼ Àe I is a; ii) for d\ À e I is zero; iii) for d [ À e I is one.
In the global alternative K : ðÀe I \d\e S Þ; since both permutation tests T I and T S are jointly consistent, the global test T G is consistent too (Pesarin 2001(Pesarin , 2016Pesarin and Salmaso 2010), that is E F ð/ T G ; dÞ ! 1. Correspondingly, for every ðd\ À e I Þ S ðd [ e S Þ the limiting rejection is E F ð/ T G ; dÞ ! 0: Moreover, in the extreme points of H, when d is either Àe I or e S ; as one and only one can be true if at least one differs from zero, the limiting rejection rate of T G is a: Moreover, if e I ¼ e S ¼ 0; this rejection rate is not defined for every sample size.
To find UI-NPC's limit behavior, firstly let us analogously consider T Ã S ðdÞ ¼ X Ã S2 À X Ã S1 . As minðn 1 ; n 2 Þ ! 1 implies that the permutation distribution of T Ã S ðdÞ weakly converges to E F ð X S2 À X S1 Þ ¼ ðd À e S Þ; then for any d [ e S the rejection rate ofT S ðdÞ converges to one. Moreover, for any d\e S its rejection rate converges to zero. At the right extreme d ¼ e S , since for any sample sizesT S ðe S Þ rejects with probability a; its limit rejection rate is also a.
The behavior ofT I ðdÞ mirrors that ofT S ðdÞ. That is, the limiting rejection rate: i) for d ¼ Àe I is a; ii) for d [ e I is zero; iii) for d\ À e I is one.
In the global alternativeK : ðd\ À e I Þ S ðd [ e S Þ since one and only one ofT I andT S is consistent, thenT G is consistent too (Pesarin 2001;Pesarin and Salmaso 2010;Pesarin et al. 2016).

A simple analysis
Calibrated values a c andã c , so as to get global type I error rate a for the IU-NPC T G and the UI-NPCT G ; if the underlying data distribution F is completely known, can be determined via Monte Carlo simulations as is done in Arboretti et al. (2018) for T G and in Pesarin et al. (2016) forT G .
Algorithms for IU-NPC and UI-NPC used to determine calibrated a c andã c (see also the Supplementary Material) can even be used to establish the designs n 1 ¼ n 2 andñ 1 ¼ñ 2 such that the maximum power W T G ð0; n; eÞ ¼ p and WT G ðAE2e;ñ; eÞ ¼ p at standardized margins e I ¼ e S ¼ e on calibrated a c andã c , respectively. The choice to consider designs at d ¼ 0 for the T G and at d ¼ AE2e for theT G resides in the fact that these values are equally far away from H andH; respectively, and so their power behaviors are comparable (Wellek 2010, Chapter 11 Referring to point e ¼ 0:60 as a pivot, the approximate sample sizes for p ¼ 0:80, the IU-NPC designs for any intermediate margins e 0 approximately agree to the empirical rule nðe 0 Þ % 48:28 Á ð0:6=e 0 Þ 2 as obtained by interpolating simulation results. It is worth noting that these IU-NPC designs are strictly close to those obtained within the naive IU-TOST € T G approach as reported in Lakens (2017). Such a practical coincidence is mostly due to the fact that: i) calibrated a c coincides with non-calibrated a for interval length, adjusted with sample sizes, of about ðe I þ e S Þ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi n 1 n 2 =nr 2 p [ 5:4; and ii) permutation tests are convergent at a high rate to the corresponding parametric solutions (Hoeffding 1952). On the other hand, for UI-NPC the related empirical rule for intermediate margins e 0 isñðe 0 Þ % 35:33 Á ð0:6=e 0 Þ 2 : Similar approximate rules for p ¼ 0:50 are nðe 0 Þ % 30:25 Á ð0:6=e 0 Þ 2 and nðe 0 Þ % 16:03 Á ð0:6=e 0 Þ 2 , for IU-NPC and UI-NPC respectively. It is worth From these results we may derive a sort of relative efficiency rate of UI-NPC with respect to IU-NPC. For instance, at e ¼ 0:60 and p ¼ 0:80 the rate of sample sizes is n=ñ % 1:36, for p ¼ 0:50 it is n=ñ % 1:88; and for p ¼ 0:30 (details not reported) it is n=ñ % 2:57. In practice, relative efficiency rates are mostly dependent on power p and are almost e-invariant. Table 2 reports, for standard normal data (r unknown) with n 1 ¼ n 2 ¼ 12 and e ¼ ð4=5; 3=5; 2=5; 1=3; 1=5; 1=10Þ, calibrated a c ;ã c ; rejection rates of H at d ¼ 0 and d ¼ AE2e for the IU-NPC T G and the naive IU-TOST € T G , and ofH for the UI-NPCT G ; all obtained with MC ¼ 5000 and R ¼ 2500: In order to clarify how to read T G appears to be dramatically conservative since its maximum power of W € T G ð0Þ ¼ 0:001 is much smaller than a ¼ 0:05: Thus, since its power is much smaller than a; naive € T G cannot be seriously considered as a practical way to test for Eq. W T G ð0Þ ¼ 0:076 in contrast with WT G ðAE0:8Þ ¼ 0:249; when a comparison can be stated, manifests that the UI-NPC is considerably more efficient than the IU-NPC in detecting the respective comparable alternative.
From these results we can see that IU-NPC appears to be mostly focused on NEq as the main assertion under testing, i.e. the one to be falsified if not true, so exhibiting an intrinsic propensity to retain H even when it is not true. Thus, its applications are mostly with problems where rejection of true Eq has relatively smaller costs than its acceptance when NEq is true while taking under strict control related global errors. This is typically the case in the areas of bioequivalence and pharmacostatistics, where it is considered ethical to retain A (the ''old drug'') unless there is empirical evidence that B (the ''competitor'') is Eq to it. On the other hand, UI-NPC appears to be mostly focused on Eq, so exhibiting a relatively larger propensity to retainH when it is true. Thus, its applications are mostly with problems where rejection of true Eq has relatively greater costs than acceptance of a false NEq while taking under strict control related global errors. This generally occurs with testing aims to go beyond traditional two-sided procedures, as for instance with quality control, etc. It is also important to emphasize that for e 0:333 the maximum probability for the naive IU-TOST € T G to retain Eq, when it is true, is zero [see also points ÏÜ .3, ÏÜ .5, ÏÜ .6 in Sect. 7.2], so resulting in pure costs without any inferential benefits. Table 3 reports, for data from N(0, 1) (r unknown), the minimal sample sizes € n 1 ¼ € n 2 ; in terms of e ¼ e I ¼ e S ; for naive IU-TOST € T G when conditions a) and b) are satisfied, i.e. to be unbiased at € a G ¼ :05; and the maximum probability (i.e. the power) to accept Eq [ € WðEqÞ] at d ¼ 0. If r were known we have essentially the same results. It is proved that when ðn 1 ; n 2 Þ and/or e I þ e S are not sufficiently large (Wellek, 2010, p. 5), the naive IU-TOST € T G ; as is frequently used in the literature, can be unacceptably biased (Sect. 7.2).

A bioequivalence application
Let us consider data from (Hirotsu (2017), p. 108) on the end-point variable Log C max (Log of maximum blood concentration of a drug), related to n 1 ¼ 20 Japanese subjects and n 2 ¼ 13 Caucasians, after prescribing a standard dose of a drug. Data concern a bridging study conducted to investigate for bioequivalence between two populations. So, the test is to see if two populations can be considered bioequivalent with respect to that variable. Data are reported in Table 4.
The results in brackets are related to mid-rank data transformations. In our opinion, due to some apparent irregular data concentrations and some ties, mid-rank results can be slightly more reliable than those on plain data X (IU.3 Sect. 7.1, and UI.1 Sect. 7.3). At e such that € aðeÞ ¼ a G ¼ 0:05, i.e. e % 0:071 (corresponding to % 0:82rÞ; type I error rates of naive IU-TOST € T G ðeÞ and of IU-NPC T G approximately coincide. Of course, this coincidence also remains for larger sample sizes and margins. With the data of the example, the Eq of two data sets is retained by the IU-NPC T G for margins e I ¼ e S J0:12 % 1:38r. For margins e I ¼ e S \0:12, we could state that there is not enough information to conclude that the two populations are equivalent. Anyway, it also well known in the literature that the IU-NPC approach suffers from a lack of power (e.g., Berger and Hsu 1996;Wellek 2010). On the other hand, the UI-NPCT G retains Eq for all margins, including e I ¼ e S ¼ 0 (in such a caseã c ¼ a=2 and the related p value statistic iŝ kG ¼k 0 ¼ 0:0535 [ 0:025Þ.

The IU-NPC solution
The IU-NPC approach, as well as the likelihood-based IU, presents some pitfalls, as is evident from previous results (see also the Supplementary Material). The most important requirements and pitfalls are: • IU.1) It does not admit any solution when e I ¼ e S ¼ 0; i.e. when the null hypotheses is H : ½ðd 0Þ S ðd ! 0Þ in which case the alternative K becomes logically impossible as it is empty, K ¼ £ say.
• IU.2) When the T G measure of e I þ e S is small, there still remain difficulties in retaining Eq when it is true. This difficulty is well recognized in the literature. For instance, (Wellek (2010), p. 5) says ''...the sample sizes required in an equivalence test in order to achieve a reasonable power typically tend to be considerably larger than in an ordinary one-or two-sided testing procedure ...unless the range of tolerance deviations ...is chosen so wide that even distributions exhibiting pronounced dissimilarities would be declared 'equivalent' ...''. The same difficulties are confirmed by simulation results (Arboretti et al. 2018). • IU.3) Using Monte Carlo to achieve the IU-NPC calibrated a c requires complete knowledge of underlying distribution F of variable X, including all its nuisance parameters. When a central limit theorem is working for partial test distributions, calibrated a c can be approximately assessed by a simulation algorithm as in (Arboretti et al. (2018), see also the Supplementary Material) where the unknown standard deviation r X is replaced by its sampling estimater X . Thus, assessing a c endures two sources of approximations. This difficulty is particularly intriguing when sample sizes ðn 1 ; n 2 Þ and/or Eq interval length e I þ e S are small. However, if data X are provided with finite second moment, IU-NPC is little influenced by mis-specification of data distribution F [also UI.3, Sect. 7.3)]. When no assumption on underlying F is undertaken, then mid-rank transformation of the numeric data X and margins ðe I ; e S Þ may provide for reliable evaluation of calibrated a c , provided that normal approximation for Wilcoxon-Mann-Whitney statistics takes place, i.e. for sample sizes of about 10 or larger. • IU.4) According to results in Arboretti et al. (2018) and based on limiting behavior of the permutation test as stated in (Hoeffding (1952), IU-NPC test T G ¼ minðT I ; T S Þ quickly converges to T opt G in the conditions for the latter. • IU.5) Unless minðn 1 ; n 2 Þ or e I þ e S are very large, once Eq is rejected, the application of a Bonferroni-like rule for establishing which H h ; h ¼ I; S; is active, if not always impossible, is generally difficult since calibrated a c lie in the half-open interval ½a; ð1 þ aÞ=2Þ: • IU.6) In practice, to analyze a given data set ðX 1 ; X 2 Þ, with ðn 1 ; n 2 Þ sample sizes, margins ðe I ; e S Þ; at significance level a; one has to firstly establish or to estimate a c via Monte Carlo as in point IU.3; then, one can proceed with the IU-NPC analysis. This implies using two computing algorithms. • IU.7) While using any kind of ranks, only within the IU-NPC permutation approach is it possible to express margins in terms of the same physical measurement units of variable X. Rank solutions as discussed in Wellek (2010) and Janssen and Wellek (2010) express margins in terms of rank transformations so as to mimic solutions based on normal settings. However, this implies considering something similar to random margins, the meaning of which become doubtful or at least questionable and too difficult to justify (Arboretti et al. 2015;Hirotsu 2007). This same difficulty is also met when monotonic data transformations, such as X ¼ uðYÞ; are necessary and margins are expressed in terms of transformed values X. In any case, provided that margins are clearly justified, IU-NPC can be correctly applied if these are expressed either in terms of original data Y or in terms of transformed data X.
• IU.8) The multidimensional extension of the IU approach by likelihood methods is far from satisfactory, especially outside normal distributions. We think this extension can easily be done under the NPC and we intend to do it in future research. • IU.9) Calibrated reference values under the parametric likelihood ratio approach are obtained by numerical calculations (Wellek 2010;Lehmann 1986) only for population distributions lying within the regular exponential family if the invariance property for nuisance parameters (if any) works. Outside, only approximated solutions can be obtained [IU.3]. So the IU parametric approach is extremely demanding. Moreover, whenever the minimal sufficient statistics in the null hypothesis is the whole n-dimensional data set X, only nonparametric permutation solutions can be set up correctly (Pesarin 2015(Pesarin , 2016Pesarin and Salmaso 2010).

The naive IU-TOST solution
The naive IU-TOST solution, € T G ¼ minðT I ; T S Þ say, as is frequently considered in the literature (Anderson-Cook and Borror 2016;Berger 1982;Berger and Hsu 1996;Pardo 2014;Patterson and Jones 2017;Richter and Richter 2002;Schuirmann 1987;Wellek 2010), corresponds to the non-calibrated version that rejects the global H at type I error rate a when both partial tests reject each other at the same rate a in place of calibrated a c ; i.e. when € a I ¼ € a S ¼ a: This naive € T G solution has several further specific pitfalls: • ÏÜ .1) It satisfies condition a) but not b) in Sect. 2; however, it trivially satisfies Theorem 1 in Berger (1982) and Berger and Hsu (1996). • ÏÜ .2) When the T G measure of e I þ e S is very large, the non-calibrated naive € T G ; whose partial type I error rates are € a I ¼ € a S ¼ a c ¼ a; and the calibrated IU-NPC T G coincide, and so they are both consistent (Sect. 4).
3) The naive IU-TOST € T G can be dramatically conservative and its maximum rejection probability can be much smaller than a; even exactly zero (Arboretti et al. 2018), see ÏÜ .5 and results in Sect. 5 (see also the Supplementary Material).
• ÏÜ .4) In Theorem 2 in Berger (1982) and Berger and Hsu (1996), essentially states that margins ðe I ; e S Þ exist such that the power under K of naive test € T G is not smaller than a: Since € T G is consistent, as the standardized length of the Eq interval diverges at the rate ½n 1 n 2 =ðn 1 þ n 2 Þ 1=2 ; if minðn 1 ; n 2 Þ diverges, such an existence corresponds to consistency. However, it is important to underline that such a condition is not constructive and so is not beneficial to finding practical solutions. Indeed, in any real problem, based on technical or biological or regulatory considerations, margins are established before the experiment for data collection is conducted. So, since it is unknown if the € T G measure of ðe I þ e S Þ with actual sample data is sufficiently large so that € a ¼ a c ¼ a; naive € T G solutions do not guarantee minimal requirements in order to be considered valid test statistics.
• ÏÜ .5) Paradoxically, when the Eq interval length e I þ e S is small in terms of the € T G distribution, the maximum probability for the naive IU-TOST € T G of finding a drug equivalent to itself can be exactly zero. This generally occurs when two partial rejection regions have no common points, i.e. when / S T / I ¼ ; so leading to impossible events, where / I and / S are the a-rejection regions of T I and T S ; respectively. For instance, with: n 1 ¼ n 2 ¼ 12, e I ¼ e S ¼ 0:25, X $ Nð0; 1Þ and € a I ¼ € a S ¼ 0:05; by a simulation with MC ¼ 5000 and R ¼ 2500 the type I error for € T G is € a G % 0:000 and, much worse, the maximum estimated powerŴ € T G ð0Þ % 0:000. Interestingly, the calibrated IU-NPC a c is about 0.293 (that of UI-NPCT G isã c % 0:047; see also the Supplementary Material). In this respect it is easy to see that for normal data, with known r and e I ¼ e S ¼ e, the maximum probability to retain Eq is exactly zero up to n 1 ¼ n 2 ¼ b2ðz a r=eÞ 2 c; with bðÁÞc the integer part of (Á) and z a the a-quantile of N(0, 1). • ÏÜ .6) As a consequence, naive IU-TOST € T G tests are not members of the set of test statistics that satisfy conditions a) and b) in Sect. 2. Moreover, as the global type I error rate and power can both be considerably smaller than a for small sample sizes and/or small Eq interval length, we may state that the naive € T G testing procedure is based on an incorrect methodology, meaning that it can happen that true type I error results aðAEe; nÞ ( a and maximal power, at d ¼ 0; W € T G ð0; n; eÞ ( a, conditions that do not agree with the minimal requirements for any test (Nunnally 1960, and Sect. 2). Thus, in our opinion, unless sample sizes and/or Eq interval length are sufficiently large, there is no reason for taking naive € T G into consideration in Eq testing. Essentially, this is our basic criticism regarding the widespread use of the naive IU-TOST method (e.g. Anderson-Cook and Borror (2016), Pesarin (1990Pesarin ( , (1992, among the many). We think that this intrinsic defect remains hidden to most practitioners because naive IU-TOST apparently sounds non-counter-intuitive.
• ÏÜ .7) Direct consequence of former two points is that for naive IU-TOST € T G the cumulation of inferences from independent studies could be unsuitable. For instance, if there are m ! 2 analyses, each based on insufficiently large sample sizes, as is common in some meta-analyses and multicenter studies, their combination might always reject that a drug is Eq to itself. Indeed, for valid combination it is required that all m partial tests are unbiased (i.e. minimal power ! a, Sect. 2). In fact, if for study h, h ¼ 1; . . .; m;/ Sh T / Ih ¼ ;; i.e. the joint rejection region of any two partial tests T Sh and T Ih is empty, the p value related to € T Gh is 1 and so p value of any of its combinations is also 1, hence always providing for NEq, true or not.

The UI-NPC solution
The most important requirements and pitfalls of the UI-NPC are: • UI.1) Using Monte Carlo to establish the calibratedã c requires complete knowledge of underlying distribution F of endpoint variable X, including all its nuisance parameters [same as IU.3, Sect. 7.1)]. When, for partial test distributions, a central limit theorem is working, calibratedã c can be approximately determined according to Arboretti et al. (2018), since the Eq interval length e I þ e S can be measured in terms of underlying standard error r X ½n 1 n 2 =ðn 1 þ n 2 Þ À1=2 : As in practice r X is unknown, substitution by its sampling estimater X implies thatã c can be assessed only approximately. It is worth noting, however, that the related degree of approximation is generally negligible in practice because: i) its true value lies in the closed interval ½ 1 2 a; a and so the maximum approximation error is bounded by a=2; ii) for any given Eq interval, calibratedã c quickly converges to a for increasing sample sizes, provided that the population mean E F ðXÞ is finite. When population mean is assumed not to be finite, then mid-rank transformation of the numeric data X and margins ðe I ; e S Þ, can provide for well approximated evaluations of calibratedã c ; provided that normal approximation for Wilcoxon-Mann-Whitney statistics takes place.
• UI.2) Similarly to point IU.6 (Sect. 7.1) to analyze a given data set ðX 1 ; X 2 Þ, with ðn 1 ; n 2 Þ sample sizes, margins ðe I ; e S Þ; at significance level a; one has to firstly establish or to estimateã c via Monte Carlo as at point UI.1; then, one can proceed with the UI-NPC analysis. This too implies using two computing algorithms, but with much less impact than with IU-NPC, becauseã c 2 ½ 1 2 a; a; which is a much smaller range than ½a; ð1 þ aÞ=2Þ: Indeed, a similar five-entry table would require much smaller numbers of sample sizes and margins. • UI.3) Once NEq is retained at significance level a; identifying which of two arms is mostly responsible for that result using a Bonferroni-like rule implies that the related type I error is in ½ 1 2 a; a, and so the related type I error rate is not less than a=2: Indeed, it is close to a even for moderate sample sizes and small Eq interval length since, in practice, UI-NPC is intrinsically robust against mis-specification of underlying F, possibly after data transformations achieving near symmetry. In this regard, with data from a Student's t distribution with 2 df (zero mean and infinite variance), n 1 ¼ n 2 ¼ 12, e I ¼ e S ¼ 0:321; corresponding to margins of about 0.25 for standard normally distributed data since PrfÀ0:25 Nð0; 1Þ 0:25g ¼ PrfÀ0:321 t 2 0:321g; we have a c % 0:375 andã c % 0:047. Compared to those that are active under standard normal data, as in ÏÜ .5 (Sect. 7.2), a c proves to be much larger than 0.293, and so the IU-NPC appears not to be robust against F; insteadã c coincides at the third figure with 0.047, confirming that the UI-NPC is at least approximately invariant on F, provided that near symmetry for the data is achieved. The robustness properties of IU-NPC and UI-NPC will be considered in further research.
• UI.4) When e I ¼ e S ¼ 0; i.e. for sharp null and two-sided alternatives, unless the underlying data distribution is symmetric, it is well known that it is difficult to find unbiased tests based on comparison of sample averages (Cox and Hinkley 1974;Lehmann 1986). Within the UI-NPC, however, the testT G ¼ max½ð X 1 À X 2 Þ; ð X 2 À X 1 Þ is always at least unbiased at a=2: • UI.5) Similarly to IU.9 (Sect. 7.1), calibrated reference values under the parametric likelihood ratio approach are obtained by numerical calculations only for population distributions lying within the regular exponential family if the invariance property for nuisance parameters (if any) works (Ferguson 1967). So, like the IU, the UI parametric approach is also quite demanding. On the contrary, when no parametric UI is available, approximations within UI-NPC generally suffice for most practical applications [UI.1].

Concluding remarks
The present paper provides a sort of comparative analysis of two nonparametric permutation approaches for Eq testing problems. In accordance with the majority of the literature on the subject matter, one is based on the IU principle. The other is based on the UI principle. Although they entail different evaluations of inferential errors, both are rationally suitable for such testing and so they are not strictly comparable. As such, rather than a proper comparison, we have proposed a sort of weak comparative (parallel) analysis. However, we believe that neither can be considered uniformly the best to be used for all possible problems. Thus, our analysis is mostly concerned with highlighting their respective requirements, properties, difficulties, inferential costs, limitations and pitfalls. One important point we took into consideration was that in some of the literature the IU solution is used referring to the so-called non-calibrated reference critical values. We called it the naive IU-TOST solution. In this regard, we showed (see ÏÜ .5 and ÏÜ .6, Sect. 7.2) that since its type I error rate and power for relatively small margins and/or sample sizes can be zero, thus implying rejection of Eq, true or not, with a probability close to one, its related testing process can become absolutely useless, resulting in pure costs without any inferential benefits. This rather erroneous feature may lead, for instance, to the unacceptable conclusion that ''the probability to find that a drug is Eq to itself by the naive IU-TOST can be zero''.
A further aspect we would like to consider is a sort of comparison between the IU and the UI with respect to the so-called point null hypotheses. A point null is equivalent to considering e I ¼ e S ¼ 0; with length of equivalence interval of zero. On the one hand, the UI way coincides with the traditional two-sided solution plus one more: once the null has been rejected, its p value k ¼ minðk I ; k S Þ satisfies Bonferroni's rule (UI.3, Sect. 7.3) and allows us to make inference on which is the active arm: e.g. if k ¼ k I then d\0, at type I rateã c ¼ a=2 (similarly for d S ). On the other hand, the IU way cannot have any solution, so in this formulation a point null cannot be considered as a null interval. This too shows that two formulations are essentially different.
A problem faced by any researcher is finding guidance to choose between two approaches. Our point of view is that if he/she considers that rejection of Eq when it is true has relatively smaller costs than its acceptance when NEq is true, as can typically be considered the case with bioequivalence and pharmacostatistics, then the IU-NPC is the correct choice. Correspondingly, if he/she considers that rejection of Eq when it is true has relatively greater costs than its acceptance when NEq is true, as can typically be the case with traditional two-sided testing (quality control, etc.), then the UI-NPC is the correct choice.
In the usual literature on the subject matter, both IU and UI parametric approaches are essentially worked out within likelihood techniques. These approaches, which in any case imply approximate solutions, are rather difficult to deal with since they require quite severe conditions of validity, such as population distributions lying within the regular exponential family and enjoying the invariant property for nuisance parameters, if any-conditions that are generally quite difficult to meet and/or justify. Our IU-NPC and UI-NPC permutation solutions are also approximated. However, when a parametric optimal solution exists, its NPC counterpart is asymptotically convergent to it at a high rate. When a solution within likelihood ratio is not invariant with respect to one or more nuisance parameters, it cannot be worked out unless these nuisance parameters are completely known. Our IU-NPC and UI-NPC solutions, given they are working conditionally on a set of sufficient statistics in one point of the null hypothesis, do not require any knowledge of nuisance parameters, so are sufficiently flexible to cope with most practical problems.