Type: | Package |
Title: | Testing for Equivalence and Noninferiority |
Version: | 1.0.2 |
Date: | 2021-06-29 |
Author: | Stefan Wellek, Peter Ziegler |
Maintainer: | Stefan Wellek <stefan.wellek@zi-mannheim.de> |
Description: | Making available in R the complete set of programs accompanying S. Wellek's (2010) monograph ”Testing Statistical Hypotheses of Equivalence and Noninferiority. Second Edition” (Chapman&Hall/CRC). |
License: | CC0 |
Depends: | R (≥ 3.0.0), stats, BiasedUrn |
NeedsCompilation: | no |
Packaged: | 2021-07-12 11:25:57 UTC; ziegler |
Repository: | CRAN |
Date/Publication: | 2021-07-12 13:10:02 UTC |
Testing for equivalence and noninferiority
Description
The package makes available in R the complete set of programs accompanying S. Wellek's (2010) monograph "Testing Statistical Hypotheses of Equivalence and Noninferiority. Second Edition" (Chapman&Hall/CRC).
Note
In order to keep execution time of all examples below the limit set by the CRAN administration, in a number of cases the function calls shown in the documentation contain specifications which are insufficient for real applications. This holds in particular true for the width sw of search grids, which should be chosen to be .001 or smaller. Similarly, the maximum number of interval halving steps to be carried out in finding maximally admissible significance levels should be set to values >= 10.
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
Maintainer: Stefan Wellek <stefan.wellek@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition. Boca Raton: Chapman & Hall/CRC Press, 2015.
Examples
bi2ste1(397,397,0.0,0.025,0.511,0.384)
bi2ste2(0.0,0.025,0.95,0.8,0.80,1.0)
Internal Equiv_Noninf Functions
Description
Internal Equiv_Noninf functions
Details
These functions are not to be called by the user
Critical constants and power of the UMP test for equivalence of a single binomial proportion to some given reference value
Description
The function computes the critical constants defining the uniformly most powerful (randomized) test
for the problem p \le p_1
or p \ge p_2
versus
p_1 < p < p_2
, with p
denoting the parameter of
a binomial distribution from which a single sample of size
n
is available. In the output, one also finds the power
against the alternative that the true value of p
falls on the
midpoint of the hypothetical equivalence interval (p_1 , p_2).
Usage
bi1st(alpha,n,P1,P2)
Arguments
alpha |
significance level |
n |
sample size |
P1 |
lower limit of the hypothetical equivalence
range for the binomial parameter |
P2 |
upper limit of the hypothetical equivalence
range for |
Value
alpha |
significance level |
n |
sample size |
P1 |
lower limit of the hypothetical equivalence
range for the binomial parameter |
P2 |
upper limit of the hypothetical equivalence
range for |
C1 |
left-hand limit of the critical interval for
the observed number |
C2 |
right-hand limit of the critical interval for
|
GAM1 |
probability of rejecting the null hypothesis
when it turns out that |
GAM2 |
probability of rejecting the null hypothesis
for |
POWNONRD |
Power of the nonrandomized version of the test against the alternative |
POW |
Power of the randomized UMP test against the
alternative |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority.
Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, \S
4.3.
Examples
bi1st(.05,273,.65,.75)
Power of the exact Fisher type test for equivalence
Description
The function computes exact values of the power of the randomized UMPU test for equivalence in the strict (i.e. two-sided) sense of two binomial distributions and the conservative nonrandomized version of that test. It is assumed that the samples being available from both distributions are independent.
Usage
bi2aeq1(m,n,rho1,rho2,alpha,p1,p2)
Arguments
m |
size of Sample 1 |
n |
size of Sample 2 |
rho1 |
lower limit of the hypothetical equivalence range for the odds ratio |
rho2 |
upper limit of the hypothetical equivalence range for the odds ratio |
alpha |
significance level |
p1 |
true success rate in Population 1 |
p2 |
true success rate in Population 2 |
Value
m |
size of Sample 1 |
n |
size of Sample 2 |
rho1 |
lower limit of the hypothetical equivalence range for the odds ratio |
rho2 |
upper limit of the hypothetical equivalence range for the odds ratio |
alpha |
significance level |
p1 |
true success rate in Population 1 |
p2 |
true success rate in Population 2 |
POWNR |
Power of the nonrandomized version of the test |
POW |
Power of the randomized UMPU test |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority.
Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.6.4.
Examples
bi2aeq1(302,302,0.6667,1.5,0.05,0.5,0.5)
Sample sizes for the exact Fisher type test for equivalence
Description
The function computes minimum sample sizes required in the randomized UMPU test for
equivalence of two binomial distributions with respect to the odds ratio. Computation is done under
the side condition that the ratio m/n
has some predefined value \lambda
.
Usage
bi2aeq2(rho1,rho2,alpha,p1,p2,beta,qlambd)
Arguments
rho1 |
lower limit of the hypothetical equivalence range for the odds ratio |
rho2 |
upper limit of the hypothetical equivalence range for the odds ratio |
alpha |
significance level |
p1 |
true success rate in Population 1 |
p2 |
true success rate in Population 2 |
beta |
target value of power |
qlambd |
sample size ratio |
Value
rho1 |
lower limit of the hypothetical equivalence range for the odds ratio |
rho2 |
upper limit of the hypothetical equivalence range for the odds ratio |
alpha |
significance level |
p1 |
true success rate in Population 1 |
p2 |
true success rate in Population 2 |
beta |
target value of power |
qlambd |
sample size ratio |
M |
minimum size of Sample 1 |
N |
minimum size of Sample 2 |
POW |
Power of the randomized UMPU test attained with the computed values of m,n |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.6.4.
Examples
bi2aeq2(0.5,2.0,0.05,0.5,0.5,0.60,1.0)
Determination of a maximally raised nominal significance level for the nonrandomized version of the exact Fisher type test for equivalence
Description
The objective is to raise the nominal significance level as far as possible without exceeding the target significance level in the nonrandomized version of the test. The approach goes back to R.D. Boschloo (1970) who used the same technique for reducing the conservatism of the traditional nonrandomized Fisher test for superiority.
Usage
bi2aeq3(m,n,rho1,rho2,alpha,sw,tolrd,tol,maxh)
Arguments
m |
size of Sample 1 |
n |
size of Sample 2 |
rho1 |
lower limit of the hypothetical equivalence range for the odds ratio |
rho2 |
upper limit of the hypothetical equivalence range for the odds ratio |
alpha |
significance level |
sw |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
tolrd |
horizontal distance from 0 and 1, respectively of the left- and right-most boundary point to be included in the search grid |
tol |
upper bound to the absolute difference between size and target level below which the search for a corrected nominal level terminates |
maxh |
maximum number of interval halving steps to be carried out in finding the maximally raised nominal level |
Details
It should be noted that, as the function of the nominal level, the size of the nonrandomized test is piecewise constant. Accordingly, there is a nondegenerate interval of "candidate" nominal levels serving the purpose. The limits of such an interval can be read from the output. In terms of execution time, bi2aeq3 is the most demanding program of the whole package.
Value
m |
size of Sample 1 |
n |
size of Sample 2 |
rho1 |
lower limit of the hypothetical equivalence range for the odds ratio |
rho2 |
upper limit of the hypothetical equivalence range for the odds ratio |
alpha |
significance level |
sw |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
tolrd |
horizontal distance from 0 and 1, respectively of the left- and right-most boundary point to be included in the search grid |
tol |
upper bound to the absolute difference between size and target level below which the search for a corrected nominal level terminates |
maxh |
maximum number of interval halving steps to be carried out in finding the maximally raised nominal level |
ALPH_0 |
current trial value of the raised nominal level searched for |
NHST |
number of interval-halving steps performed up to now |
SIZE |
size of the critical region corresponding to |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Boschloo RD: Raised conditional level of significance for the 2 x 2- table when testing the equality of two probabilities. Statistica Neerlandica 24 (1970), 1-35.
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.6.5.
Examples
bi2aeq3(50,50,0.6667,1.5000,0.05,0.01,0.000001,0.0001,5)
Objective Bayesian test for noninferiority in the two-sample setting with binary data and the odds ratio as the parameter of interest
Description
Implementation of the construction described on pp. 179–181 of Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Usage
bi2by_ni_OR(N1,N2,EPS,SW,NSUB,ALPHA,MAXH)
Arguments
N1 |
size of sample 1 |
N2 |
size of sample 2 |
EPS |
noninferiority margin to the deviation of the odds ratio from unity |
SW |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
NSUB |
number of subintervals for partitioning the range of integration |
ALPHA |
target significance level |
MAXH |
maximum number of interval halving steps to be carried out in finding the maximally admissible nominal level |
Details
The program uses 96-point Gauss-Legendre quadrature on each of the NSUB intervals into which the range of integration is partitioned.
Value
N1 |
size of sample 1 |
N2 |
size of sample 2 |
EPS |
noninferiority margin to the deviation of the odds ratio from unity |
NSUB |
number of subintervals for partitioning the range of integration |
SW |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
ALPHA0 |
result of the search for the largest admissible nominal level |
SIZE0 |
size of the critical region corresponding to |
SIZE_UNC |
size of the critical region of the test at uncorrected nominal level |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Statistical methods for the analysis of two-arm non-inferiority trials with binary outcomes. Biometrical Journal 47 (2005), 48–61.
Wellek S: Testing statistical hypotheses of equivalence and
noninferiority. Second edition. Boca Raton:
Chapman & Hall/CRC Press, 2010, \S
6.6.2.
Examples
bi2by_ni_OR(10,10,1/3,.0005,10,.05,12)
Objective Bayesian test for noninferiority in the two-sample setting with binary data and the difference of the two proportions as the parameter of interest
Description
Implementation of the construction described on pp. 185-6 of Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Usage
bi2by_ni_del(N1,N2,EPS,SW,NSUB,ALPHA,MAXH)
Arguments
N1 |
size of Sample 1 |
N2 |
size of sample 2 |
EPS |
noninferiority margin to the difference of success probabilities |
SW |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
NSUB |
number of subintervals for partitioning the range of integration |
ALPHA |
target significance level |
MAXH |
maximum number of interval halving steps to be carried out in finding the maximally admissible nominal level |
Details
The program uses 96-point Gauss-Legendre quadrature on each of the NSUB intervals into which the range of integration is partitioned.
Value
N1 |
size of Sample 1 |
N2 |
size of sample 2 |
EPS |
noninferiority margin to the difference of success probabilities |
NSUB |
number of subintervals for partitioning the range of integration |
SW |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
ALPHA0 |
result of the search for the largest admissible nominal level |
SIZE0 |
size of the critical region corresponding to |
SIZE_UNC |
size of the critical region of the test at uncorrected nominal level |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Statistical methods for the analysis of two-armed non-inferiority trials with binary outcomes. Biometrical Journal 47 (2005), 48–61.
Wellek S: Testing statistical hypotheses of equivalence and
noninferiority. Second edition. Boca Raton:
Chapman & Hall/CRC Press, 2010, \S
6.6.3.
Examples
bi2by_ni_del(20,20,.10,.01,10,.05,5)
Determination of a corrected nominal significance level for the asymptotic test for equivalence
of two unrelated binomial proportions with respect to the difference \delta
of their population counterparts
Description
The program computes the largest nominal significance level
which can be substituted for the target level \alpha
without making the exact
size of the asymptotic testing procedure larger than \alpha
.
Usage
bi2diffac(alpha,m,n,del1,del2,sw,tolrd,tol,maxh)
Arguments
alpha |
significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
del1 |
absolute value of the lower limit of the hypothetical equivalence range for |
del2 |
upper limit of the hypothetical equivalence range for |
sw |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
tolrd |
horizontal distance of the left- and right-most boundary point to be included in the search grid |
tol |
upper bound to the absolute difference between size and target level below which the search for a corrected nominal level terminates |
maxh |
maximum number of interval halving steps to be carried out in finding the maximally raised nominal level |
Value
alpha |
significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
del1 |
absolute value of the lower limit of the hypothetical equivalence range for |
del2 |
upper limit of the hypothetical equivalence range for |
sw |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
tolrd |
horizontal distance of the left- and right-most boundary point to be included in the search grid |
tol |
upper bound to the absolute difference between size and target level below which the search for a corrected nominal level terminates |
maxh |
maximum number of interval halving steps to be carried out in finding the maximally raised nominal level |
NH |
number of interval-halving steps actually performed |
ALPH_0 |
value of the raised nominal level obtained after NH steps |
SIZE0 |
size of the critical region corresponding to |
ERROR |
error indicator answering the question of whether or not the sufficient condition for the correctness of the result output by the program, was satisfied |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.6.6.
Examples
bi2diffac(0.05,20,20,0.40,0.40,0.1,1e-6,1e-4,3)
Exact rejection probability of the asymptotic test for equivalence of two unrelated binomial proportions with respect to the difference of their expectations at any nominal level under an arbitrary parameter configuration
Description
The program computes exact values of the rejection probability of the asymptotic
test for equivalence in the sense of -\delta_1 < p_1-p_2 < \delta_2
, at any nominal
level \alpha_0
. [The largest \alpha_0
for which the test is valid in terms of the
significance level, can be computed by means of the program bi2diffac.]
Usage
bi2dipow(alpha0,m,n,del1,del2,p1,p2)
Arguments
alpha0 |
nominal significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
del1 |
absolute value of the lower limit of the hypothetical equivalence range for |
del2 |
upper limit of the hypothetical equivalence range for |
p1 |
true value of the success probability in Population 1 |
p2 |
true value of the success probability in Population 2 |
Value
alpha0 |
nominal significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
del1 |
absolute value of the lower limit of the hypothetical equivalence range for |
del2 |
upper limit of the hypothetical equivalence range for |
p1 |
true value of the success probability in Population 1 |
p2 |
true value of the success probability in Population 2 |
POWEX0 |
exact rejection probability under |
ERROR |
error indicator answering the question of whether or not the sufficient condition for the correctness of the result output by the program, was satisfied |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.6.6.
Examples
bi2dipow(0.0228,50,50,0.20,0.20,0.50,0.50)
Power of the exact Fisher type test for relevant differences
Description
The function computes exact values of the power of the randomized UMPU test for relevant differences between two binomial distributions and the conservative nonrandomized version of that test. It is assumed that the samples being available from both distributions are independent.
Usage
bi2rlv1(m,n,rho1,rho2,alpha,p1,p2)
Arguments
m |
size of Sample 1 |
n |
size of Sample 2 |
rho1 |
lower limit of the hypothetical equivalence range for the odds ratio |
rho2 |
upper limit of the hypothetical equivalence range for the odds ratio |
alpha |
significance level |
p1 |
true success rate in Population 1 |
p2 |
true success rate in Population 2 |
Value
m |
size of Sample 1 |
n |
size of Sample 2 |
rho1 |
lower limit of the hypothetical equivalence range for the odds ratio |
rho2 |
upper limit of the hypothetical equivalence range for the odds ratio |
alpha |
significance level |
p1 |
true success rate in Population 1 |
p2 |
true success rate in Population 2 |
POWNR |
power of the nonrandomized version of the test |
POW |
power of the randomized UMPU test |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
11.3.3.
Examples
bi2rlv1(200,300,.6667,1.5,.05,.25,.10)
Sample sizes for the exact Fisher type test for relevant differences
Description
The function computes minimum sample sizes required in the randomized UMPU test for
relevant differences between two binomial distributions with respect to the odds ratio. Computation is done
under the side condition that the ratio m/n
has some predefined value \lambda
.
Usage
bi2rlv2(rho1,rho2,alpha,p1,p2,beta,qlambd)
Arguments
rho1 |
lower limit of the hypothetical equivalence range for the odds ratio |
rho2 |
upper limit of the hypothetical equivalence range for the odds ratio |
alpha |
significance level |
p1 |
true success rate in Population 1 |
p2 |
true success rate in Population 2 |
beta |
target value of power |
qlambd |
sample size ratio |
Value
rho1 |
lower limit of the hypothetical equivalence range for the odds ratio |
rho2 |
upper limit of the hypothetical equivalence range for the odds ratio |
alpha |
significance level |
p1 |
true success rate in Population 1 |
p2 |
true success rate in Population 2 |
beta |
target value of power |
qlambd |
sample size ratio |
M |
minimum size of Sample 1 |
N |
minimum size of Sample 2 |
POW |
power of the randomized UMPU test attained with the computed values of m, n |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
11.3.3.
Examples
bi2rlv2(.6667,1.5,.05,.70,.50,.50,2.0)
Critical constants for the exact Fisher type UMPU test for equivalence of two binomial distributions with respect to the odds ratio
Description
The function computes the critical constants defining the uniformly most powerful unbiased test for
equivalence of two binomial distributions with parameters
p_1
and p_2
in terms of the odds ratio.
Like the ordinary Fisher type test of the null hypothesis
p_1 = p_2
, the test is conditional on the total number
S
of successes in the pooled sample.
Usage
bi2st(alpha,m,n,s,rho1,rho2)
Arguments
alpha |
significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
s |
observed total count of successes |
rho1 |
lower limit of the hypothetical equivalence
range for the odds ratio
|
rho2 |
upper limit of the hypothetical equivalence
range for |
Value
alpha |
significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
s |
observed total count of successes |
rho1 |
lower limit of the hypothetical equivalence
range for the odds ratio
|
rho2 |
upper limit of the hypothetical equivalence
range for |
C1 |
left-hand limit of the critical interval for
the number |
C2 |
right-hand limit of the critical interval for
|
GAM1 |
probability of rejecting the null hypothesis
when it turns out that |
GAM2 |
probability of rejecting the null hypothesis
for |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority.
Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.6.4.
Examples
bi2st(.05,225,119,171, 2/3, 3/2)
Power of the exact Fisher type test for noninferiority
Description
The function computes exact values of the power of the randomized UMPU test for one-sided equivalence of two binomial distributions and its conservative nonrandomized version. It is assumed that the samples being available from both distributions are independent.
Usage
bi2ste1(m, n, eps, alpha, p1, p2)
Arguments
m |
size of Sample 1 |
n |
size of Sample 2 |
eps |
noninferiority margin to the odds ratio |
alpha |
significance level |
p1 |
success rate in Population 1 |
p2 |
success rate in Population 2 |
Value
m |
size of Sample 1 |
n |
size of Sample 2 |
eps |
noninferiority margin to the odds ratio |
alpha |
significance level |
p1 |
success rate in Population 1 |
p2 |
success rate in Population 2 |
POWNR |
power of the nonrandomized version of the test |
POW |
power of the randomized UMPU test |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, 6.6.1.
Examples
bi2ste1(106,107,0.5,0.05,0.9245,0.9065)
Sample sizes for the exact Fisher type test for noninferiority
Description
Sample sizes for the exact Fisher type test for noninferiority
Usage
bi2ste2(eps, alpha, p1, p2, bet, qlambd)
Arguments
eps |
noninferiority margin to the odds ratio |
alpha |
significance level |
p1 |
success rate in Population 1 |
p2 |
success rate in Population 2 |
bet |
target power value |
qlambd |
sample size ratio |
Details
The program computes the smallest sample sizes m
,n
satisfying
m/n = \lambda
required for ensuring that the power of the randomized UMPU test does not
fall below \beta
.
Value
eps |
noninferiority margin to the odds ratio |
alpha |
significance level |
p1 |
success rate in Population 1 |
p2 |
success rate in Population 2 |
bet |
target power value |
qlambd |
sample size ratio |
M |
minimum size of Sample 1 |
N |
minimum size of Sample 2 |
POW |
power of the randomized UMPU test attained with the computed values of m, n |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, 6.6.1.
Examples
bi2ste2(0.5,0.05,0.9245,0.9065,0.80,1.00)
Determination of a maximally raised nominal significance level for the nonrandomized version of the exact Fisher type test for noninferiority
Description
The objective is to raise the nominal significance level as far as possible without exceeding the target significance level in the nonrandomized version of the test. The approach goes back to R.D. Boschloo (1970) who used the same technique for reducing the conservatism of the traditional nonrandomized Fisher test for superiority.
Usage
bi2ste3(m, n, eps, alpha, sw, tolrd, tol, maxh)
Arguments
m |
size of Sample 1 |
n |
size of Sample 2 |
eps |
noninferiority margin to the odds ratio |
alpha |
target significance level |
sw |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
tolrd |
horizontal distance from 0 and 1, respectively, of the left- and right-most boundary point to be included in the search grid |
tol |
upper bound to the absolute difference between size and target level below which the search for a corrected nominal level terminates |
maxh |
maximum number of interval-halving steps to be carried out in finding the maximally raised nominal level |
Details
It should be noted that, as the function of the nominal level, the size of the nonrandomized test is piecewise constant. Accordingly, there is a nondegenerate interval of "candidate" nominal levels serving the purpose. The limits of such an interval can be read from the output.
Value
m |
size of Sample 1 |
n |
size of Sample 2 |
eps |
noninferiority margin to the odds ratio |
alpha |
target significance level |
sw |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
tolrd |
horizontal distance from 0 and 1, respectively, of the left- and right-most boundary point to be included in the search grid |
tol |
upper bound to the absolute difference between size and target level below which the search for a corrected nominal level terminates |
maxh |
maximum number of interval-halving steps to be carried out in finding the maximally raised nominal level |
ALPH_0 |
current trial value of the raised nominal level searched for |
NHST |
number of interval-halving steps performed up to now |
SIZE |
size of the critical region corresponding to |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Boschloo RD: Raised conditional level of significance for the 2 x 2- table when testing the equality of two probabilities. Statistica Neerlandica 24 (1970), 1-35.
Wellek S: Testing statistical hypotheses of equivalence and noninferiority.
Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.6.2.
Examples
bi2ste3(50, 50, 1/3, 0.05, 0.05, 1e-10, 1e-8, 10)
Function to compute corrected nominal levels for the Wald type (asymptotic) test for one-sided equivalence of two binomial distributions with respect to the difference of success rates
Description
Implementation of the construction described on pp. 183-5 of Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Usage
bi2wld_ni_del(N1,N2,EPS,SW,ALPHA,MAXH)
Arguments
N1 |
size of Sample 1 |
N2 |
size of Sample 2 |
EPS |
noninferiority margin to the difference of success probabilities |
SW |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
ALPHA |
target significance level |
MAXH |
maximum number of interval-halving steps |
Details
The program computes the largest nominal significance level
to be used for determining the critical lower bound to the Wald-type statistic for the
problem of testing H:p_1 \le p_2 - \varepsilon
versus K: p_1 < p_2 - \varepsilon
.
Value
N1 |
size of Sample 1 |
N2 |
size of Sample 2 |
EPS |
noninferiority margin to the difference of success probabilities |
SW |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
ALPHA |
target significance level |
MAXH |
maximum number of interval-halving steps |
ALPHA0 |
corrected nominal level |
SIZE0 |
size of the critical region of the test at nominal level ALPHA0 |
SIZE_UNC |
size of the test at uncorrected nominal level ALPHA |
ERR_IND |
indicator taking value 1 when it occurs that the sufficient condition allowing one to restrict the search for the maximum of the rejection probability under the null hypothesis to its boundary, fails to be satisfied; otherwise the indicator retains its default value 0. |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and
noninferiority. Second edition. Boca Raton:
Chapman & Hall/CRC Press, 2010, \S
6.6.3.
Examples
bi2wld_ni_del(25,25,.10,.01,.05,10)
Exact confidence bounds to the relative excess heterozygosity (REH) exhibited by a SNP genotype distribution
Description
Implementation of the interval estimation procedure described on pp. 305-6 of Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Usage
cf_reh_exact(X1,X2,X3,alpha,SW,TOL,ITMAX)
Arguments
X1 |
count of homozygotes of the first kind [ |
X2 |
count of heterozygotes [ |
X3 |
count of homozygotes of the second kind [ |
alpha |
1 - confidence level |
SW |
width of the search grid for determining an interval covering the
parameter point at which the conditional distribution function takes
value |
TOL |
numerical tolerance to the deviation between the computed confidence limits and their exact values |
ITMAX |
maximum number of interval-halving steps |
Details
The program exploits the structure of the family of all genotype distributions,
which is 2-parameter exponential with \log(REH)
as one of these parameters.
Value
X1 |
count of homozygotes of the first kind [ |
X2 |
count of heterozygotes [ |
X3 |
count of homozygotes of the second kind [ |
alpha |
1 - confidence level |
SW |
width of the search grid for determining an interval covering the
parameter point at which the conditional distribution function takes
value |
TOL |
numerical tolerance to the deviation between the computed confidence limits and their exact values |
ITMAX |
maximum number of interval-halving steps |
C_l_exact |
exact conditional lower |
C_r_exact |
exact conditional upper |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S, Goddard KAB, Ziegler A: A confidence-limit-based approach to the assessment of Hardy-Weinberg equilibrium. Biometrical Journal 52 (2010), 253-270.
Wellek S: Testing statistical hypotheses of equivalence and
noninferiority. Second edition. Boca Raton:
Chapman & Hall/CRC Press, 2010, \S
9.4.3.
Examples
cf_reh_exact(34,118,96,.05,.1,1E-4,25)
Mid-p-value - based confidence bounds to the relative excess heterozygosity (REH) exhibited by a SNP genotype distribution
Description
Implementation of the interval estimation procedure described on pp. 306-7 of Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Usage
cf_reh_midp(X1,X2,X3,alpha,SW,TOL,ITMAX)
Arguments
X1 |
count of homozygotes of the first kind [ |
X2 |
count of heterozygotes [ |
X3 |
count of homozygotes of the second kind [ |
alpha |
1 - confidence level |
SW |
width of the search grid for determining an interval covering the
parameter point at which the conditional distribution function takes
value |
TOL |
numerical tolerance to the deviation between the computed confidence limits and their exact values |
ITMAX |
maximum number of interval-halving steps |
Details
The mid-p algorithm serves as a device for reducing the conservatism inherent in exact confidence estimation procedures for parameters of discrete distributions.
Value
X1 |
count of homozygotes of the first kind [ |
X2 |
count of heterozygotes [ |
X3 |
count of homozygotes of the second kind [ |
alpha |
1 - confidence level |
SW |
width of the search grid for determining an interval covering the
parameter point at which the conditional distribution function takes
value |
TOL |
numerical tolerance to the deviation between the computed confidence limits and their exact values |
ITMAX |
maximum number of interval-halving steps |
C_l_midp |
lower |
C_r_midp |
upper |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Agresti A: Categorical data Analysis (2nd edn). Hoboken, NJ: Wiley, Inc., 2002, Section 1.4.5.
Wellek S, Goddard KAB, Ziegler A: A confidence-limit-based approach to the assessment of Hardy-Weinberg equilibrium. Biometrical Journal 52 (2010), 253-270.
Wellek S: Testing statistical hypotheses of equivalence and
noninferiority. Second edition. Boca Raton:
Chapman & Hall/CRC Press, 2010, \S
9.4.3.
Examples
cf_reh_midp(137,34,8,.05,.1,1E-4,25)
Critical constants and power against the null alternative of the UMP test for equivalence of the hazard rate of a single exponential distribution to some given reference value
Description
The function computes the critical constants defining the uniformly most powerful test for the problem
\sigma \le 1/(1 + \varepsilon)
or \sigma\ge (1 + \varepsilon)
versus 1/(1 + \varepsilon) < \sigma < (1 + \varepsilon)
,
with \sigma
denoting the scale parameter [\equiv
reciprocal hazard rate] of an exponential distribution.
Usage
exp1st(alpha,tol,itmax,n,eps)
Arguments
alpha |
significance level |
tol |
tolerable deviation from |
itmax |
maximum number of iteration steps |
n |
sample size |
eps |
margin determining the hypothetical equivalence range symmetrically on the log-scale |
Value
alpha |
significance level |
tol |
tolerable deviation from |
itmax |
maximum number of iteration steps |
n |
sample size |
eps |
margin determining the hypothetical equivalence range symmetrically on the log-scale |
IT |
number of iteration steps performed until reaching the stopping criterion corresponding to TOL |
C1 |
left-hand limit of the critical interval for
|
C2 |
right-hand limit of the critical interval for
|
ERR1 |
deviation of the rejection probability from |
POW0 |
power of the randomized UMP test against the
alternative |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority.
Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, \S
4.2.
Examples
exp1st(0.05,1.0e-10,100,80,0.3)
Critical constants and power of the UMPI (uniformly most powerful invariant) test for dispersion equivalence of two Gaussian distributions
Description
The function computes the critical constants defining the optimal test for the problem
\sigma^2/\tau^2 \le \varrho_1
or \sigma^2/\tau^2 \ge \varrho_2
versus \varrho_1 < \sigma^2/\tau^2 < \varrho_2
,
with (\varrho_1,\varrho_2)
as a fixed nonempty interval around unity.
Usage
fstretch(alpha,tol,itmax,ny1,ny2,rho1,rho2)
Arguments
alpha |
significance level |
tol |
tolerable deviation from |
itmax |
maximum number of iteration steps |
ny1 |
number of degrees of freedom of the estimator of
|
ny2 |
number of degrees of freedom of the estimator of
|
rho1 |
lower equivalence limit to |
rho2 |
upper equivalence limit to |
Value
alpha |
significance level |
tol |
tolerable deviation from |
itmax |
maximum number of iteration steps |
ny1 |
number of degrees of freedom of the estimator of
|
ny2 |
number of degrees of freedom of the estimator of
|
rho1 |
lower equivalence limit to |
rho2 |
upper equivalence limit to |
IT |
number of iteration steps performed until reaching the stopping criterion corresponding to TOL |
C1 |
left-hand limit of the critical interval for
|
C2 |
right-hand limit of the critical interval for
|
ERR |
deviation of the rejection probability from |
POW0 |
power of the UMPI test against the
alternative |
Note
If the two independent samples under analysis are from exponential rather than Gaussian distributions, the critical constants computed by
means of fstretch with \nu_1 = 2m
, \nu_2 = 2n
, can be used
for testing for equivalence with respect to the ratio of hazard rates. The only difference is that the ratio of sample means rather than variances has
to be used as the test statistic then.
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority.
Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.5.
Examples
fstretch(0.05, 1.0e-10, 50,40,45,0.5625,1.7689)
Critical constants of the exact UMPU test for approximate compatibility of a SNP genotype distribution with the Hardy-Weinberg model
Description
The function computes the critical constants defining the uniformly most
powerful unbiased test for equivalence of the population distribution of the three genotypes
distinguishable in terms of a single nucleotide polymorphism (SNP), to a distribution
being in Hardy-Weinberg equilibrium (HWE).
The test is conditional on the total count S
of alleles of the kind of interest, and
the parameter \theta
, in terms of which equivalence shall be established, is defined
by \theta = \frac{\pi_2^2}{\pi_1(1-\pi_1-\pi_2)}
, with \pi_1
and \pi_2
denoting
the population frequence of homozygotes of the 1st kind and heterozygotes, respectively.
Usage
gofhwex(alpha,n,s,del1,del2)
Arguments
alpha |
significance level |
n |
number of genotyped individuals |
s |
observed count of alleles of the kind of interest |
del1 |
absolute value of the lower equivalence limit to |
del2 |
upper equivalence limit to |
Value
alpha |
significance level |
n |
number of genotyped individuals |
s |
observed count of alleles of the kind of interest |
del1 |
absolute value of the lower equivalence limit to |
del2 |
upper equivalence limit to |
C1 |
left-hand limit of the critical interval for the observed number |
C2 |
right-hand limit of the critical interval for the observed number |
GAM1 |
probability of rejecting the null hypothesis when it turns out that |
GAM2 |
probability of rejecting the null hypothesis for |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Tests for establishing compatibility of an observed genotype distribution with Hardy-Weinberg equilibrium in the case of a biallelic locus. Biometrics 60 (2004), 694-703.
Goddard KAB, Ziegler A, Wellek S: Adapting the logical basis of tests for Hardy-Weinberg equilibrium to the real needs of association studies in human and medical genetics. Genetic Epidemiology 33 (2009), 569-580.
Wellek S: Testing statistical hypotheses of equivalence and noninferiority.
Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, \S
9.4.2.
Examples
gofhwex(0.05,475,429,1-1/1.96,0.96)
Critical constants of the exact UMPU test for absence of a substantial deficit of heterozygotes as compared with a HWE-compliant SNP genotype distribution [noninferiority version of the test implemented by means of gofhwex]
Description
The function computes the critical constants defining the UMPU test for
one-sided equivalence of the population distribution of a SNP, to a distribution
being in Hardy-Weinberg equilibrium (HWE).
A substantial deficit of heterozygotes is defined to occur when the true value of the
parametric function \omega = \frac{\pi_2/2}{\sqrt{\pi_1\pi_3}}
[called relative excess
heterozygosity (REH)] falls below unity by more than some given margin \delta_0
.
Like its two-sided counterpart [see the description of the R function gofhwex],
the test is conditional on the total count S
of alleles of the kind of interest.
Usage
gofhwex_1s(alpha,n,s,del0)
Arguments
alpha |
significance level |
n |
number of genotyped individuals |
s |
observed count of alleles of the kind of interest |
del0 |
noninferiority margin for |
Value
alpha |
significance level |
n |
number of genotyped individuals |
s |
observed count of alleles of the kind of interest |
del0 |
noninferiority margin for |
C |
left-hand limit of the critical interval for the observed number |
GAM |
probability of rejecting the null hypothesis when it turns out that |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, pp. 300-302.
Examples
gofhwex_1s(0.05,133,65,1-1/1.96)
Establishing approximate independence in a two-way contingency table: Test statistic and critical bound
Description
The function computes all quantities required for carrying out the asymptotic test
for approximate independence of two categorial variables derived in \S
9.2 of
Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Usage
gofind_t(alpha,r,s,eps,xv)
Arguments
alpha |
significance level |
r |
number of rows of the contingency table under analysis |
s |
number of columns of the contingency table under analysis |
eps |
margin to the Euclidean distance between the vector |
xv |
row vector of length |
Value
n |
size of the sample to which the input table relates |
alpha |
significance level |
r |
number of rows of the contingency table under analysis |
s |
number of columns of the contingency table under analysis |
eps |
margin to the Euclidean distance between the vector |
X(r , s) |
observed cell counts |
DSQ_OBS |
observed value of the squared Euclidean distance |
VN |
square root of the estimated asymtotic variance of |
CRIT |
upper critical bound to |
REJ |
indicator of a positive [=1] vs negative [=0] rejection decision to be taken with the data under analysis |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
9.2.
Examples
xv <- c(8, 13, 15, 6, 19, 21, 31, 7)
gofind_t(0.05,2,4,0.15,xv)
Establishing goodness of fit of an observed to a fully specified multinomial distribution: test statistic and critical bound
Description
The function computes all quantities required for carrying out the asymptotic test for goodness
rather than lack of fit of an observed to a fully specified multinomial distribution
derived in \S
9.1 of Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority.
Second edition.
Usage
gofsimpt(alpha,n,k,eps,x,pio)
Arguments
alpha |
significance level |
n |
sample size |
k |
number of categories |
eps |
margin to the Euclidean distance between the vectors |
x |
vector of length |
pio |
prespecified vector of cell probabilities |
Value
alpha |
significance level |
n |
sample size |
k |
number of categories |
eps |
margin to the Euclidean distance between the vectors |
X(1 , K) |
observed cell counts |
PI0(1 , K) |
hypothecized cell probabilities |
DSQPIH_0 |
observed value of the squared Euclidean distance |
VN_N |
square root of the estimated asymtotic variance of |
CRIT |
upper critical bound to |
REJ |
indicator of a positive [=1] vs negative [=0] rejection decision to be taken with the data under analysis |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
9.1.
Examples
x<- c(17,16,25,9,16,17)
pio <- rep(1,6)/6
gofsimpt(0.05,100,6,0.15,x,pio)
Mann-Whitney test for equivalence of two continuous distributions of arbitrary shape: test statistic and critical upper bound
Description
Implementation of the asymptotically distribution-free test for
equivalence of two continuous distributions in terms of the Mann-Whitney-Wilcoxon functional.
For details see Wellek S (2010) Testing statistical hypotheses of equivalence and
noninferiority. Second edition, \S
6.2.
Usage
mawi(alpha,m,n,eps1_,eps2_,x,y)
Arguments
alpha |
significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
eps1_ |
absolute value of the left-hand limit of the hypothetical equivalence range for
|
eps2_ |
right-hand limit of the hypothetical equivalence range for |
x |
row vector with the |
y |
row vector with the |
Details
Notation: \pi_+
stands for the Mann-Whitney functional defined by \pi_+ = P[X>Y]
,
with X\sim F \equiv
cdf of Population 1 being independent of Y\sim G \equiv
cdf of Population 2.
Value
alpha |
significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
eps1_ |
absolute value of the left-hand limit of the hypothetical equivalence range for
|
eps2_ |
right-hand limit of the hypothetical equivalence range for |
W+ |
observed value of the |
SIGMAH |
square root of the estimated asymtotic variance of |
CRIT |
upper critical bound to |
REJ |
indicator of a positive [=1] vs negative [=0] rejection decision to be taken with the data under analysis |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: A new approach to equivalence assessment in standard comparative bioavailability trials by means of the Mann-Whitney statistic. Biometrical Journal 38 (1996), 695-710.
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.2.
Examples
x <- c(10.3,11.3,2.0,-6.1,6.2,6.8,3.7,-3.3,-3.6,-3.5,13.7,12.6)
y <- c(3.3,17.7,6.7,11.1,-5.8,6.9,5.8,3.0,6.0,3.5,18.7,9.6)
mawi(0.05,12,12,0.1382,0.2602,x,y)
Determination of a corrected nominal significance level for the asymptotic test for noninferiority in the McNemar setting
Description
The program computes the largest nominal significance level
which can be substituted for the target level \alpha
without making the exact
size of the asymptotic testing procedure larger than \alpha
.
Usage
mcnasc_ni(alpha,n,del0,sw,tol,maxh)
Arguments
alpha |
significance level |
n |
sample size |
del0 |
absolute value of the noninferiority margin for |
sw |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
tol |
upper bound to the absolute difference between size and target level below which the search for a corrected nominal level terminates |
maxh |
maximum number of interval halving steps to be carried out in finding the maximally raised nominal level |
Value
alpha |
significance level |
n |
sample size |
del0 |
absolute value of the noninferiority margin for |
sw |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
ALPH_0 |
value of the corrected nominal level obtained after nh steps |
SIZE_UNC |
exact size of the rejection region of the test at uncorrected nominal level |
SIZE0 |
exact size of the rejection region of the test at nominal level |
NH |
number of interval-halving steps actually performed |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition. Boca Raton:
Chapman & Hall/CRC Press, 2010, \S
5.2.3.
Examples
mcnasc_ni(0.05,50,0.05,0.05,0.0001,5)
Bayesian test for noninferiority in the McNemar setting with the difference of proportions as the parameter of interest
Description
The program determines through iteration the largest nominal
level \alpha_0
such that comparing the posterior probability
of the alternative hypothesis K_1: \delta > -\delta_0
to the lower
bound 1-\alpha_0
generates a critical region whose size does not exceed
the target significance level \alpha
. In addition, exact values of the
power against specific parameter configurations with \delta = 0
are output.
Usage
mcnby_ni(N,DEL0,K1,K2,K3,NSUB,SW,ALPHA,MAXH)
Arguments
N |
sample size |
DEL0 |
noninferiority margin to the difference of the parameters of the marginal binomial distributions under comparison |
K1 |
Parameter 1 of the Dirichlet prior for the family of trinomial distributions |
K2 |
Parameter 2 of the Dirichlet prior for the family of trinomial distributions |
K3 |
Parameter 3 of the Dirichlet prior for the family of trinomial distributions |
NSUB |
number of subintervals for partitioning the range of integration |
SW |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
ALPHA |
target significance level |
MAXH |
maximum number of interval halving steps to be carried out in finding the maximally raised nominal level |
Details
The program uses 96-point Gauss-Legendre quadrature on each of the NSUB intervals into which the range of integration is partitioned.
Value
N |
sample size |
DEL0 |
noninferiority margin to the difference of the parameters of the marginal binomial distributions under comparison |
K1 |
Parameter 1 of the Dirichlet prior for the family of trinomial distributions |
K2 |
Parameter 2 of the Dirichlet prior for the family of trinomial distributions |
K3 |
Parameter 3 of the Dirichlet prior for the family of trinomial distributions |
NSUB |
number of subintervals for partitioning the range of integration |
SW |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
ALPHA |
target significance level |
MAXH |
maximum number of interval halving steps to be carried out in finding the maximally raised nominal level |
ALPHA0 |
result of the search for the largest admissible nominal level |
SIZE0 |
size of the critical region corresponding to |
SIZE_UNC |
size of the critical region of test at uncorrected nominal level |
POW |
power against 7 different parameter configurations with |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and
noninferiority. Second edition. Boca Raton:
Chapman & Hall/CRC Press, 2010, \S
5.2.3.
Examples
mcnby_ni(25,.10,.5,.5,.5,10,.05,.05,5)
Computation of the posterior probability of the alternative hypothesis of noninferiority in the McNemar setting, given a specific point in the sample space
Description
Evaluation of the integral on the right-hand side of Equation (5.24) on p. 88 of Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Usage
mcnby_ni_pp(N,DEL0,N10,N01)
Arguments
N |
sample size |
DEL0 |
noninferiority margin to the difference of the parameters of the marginal binomial distributions under comparison |
N10 |
count of pairs with |
N01 |
count of pairs with |
Details
The program uses 96-point Gauss-Legendre quadrature on each of 10 subintervals into which the range of integration is partitioned.
Value
N |
sample size |
DEL0 |
noninferiority margin to the difference of the parameters of the marginal binomial distributions under comparison |
N10 |
count of pairs with |
N01 |
count of pairs with |
PPOST |
posterior probability of the alternative hypothesis |
Note
The program uses Equation (5.24) of Wellek S (2010) corrected for a typo in the middle line which must read
\int_{\delta_0}^{(1+\delta_0)/2}\Big[ B\big(n_{01}+1/2,n-n_{01}+1\big)\,\,
p_{01}^{n_{01}-1/2}(1-p_{01})^{n-n_{01}}
.
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and
noninferiority. Second edition. Boca Raton:
Chapman & Hall/CRC Press, 2010, \S
5.2.3.
Examples
mcnby_ni_pp(72,0.05,4,5)
Determination of a corrected nominal significance level for the asymptotic test for equivalence of two paired binomial proportions with respect to the difference of their expectations (McNemar setting)
Description
The program computes the largest nominal significance level
which can be substituted for the target level \alpha
without making the exact
size of the asymptotic testing procedure larger than \alpha
.
Usage
mcnemasc(alpha,n,del0,sw,tol,maxh)
Arguments
alpha |
significance level |
n |
sample size |
del0 |
upper limit set to |
sw |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
tol |
upper bound to the absolute difference between size and target level below which the search for a corrected nominal level terminates |
maxh |
maximum number of interval halving steps to be carried out in finding the maximally raised nominal level |
Value
alpha |
significance level |
n |
sample size |
del0 |
upper limit set to |
sw |
width of the search grid for determining the maximum of the rejection probability on the common boundary of the hypotheses |
ALPH_0 |
value of the corrected nominal level obtained after nh steps |
NH |
number of interval-halving steps actually performed |
ERROR |
error indicator messaging "!!!!!" if the sufficient condition for the correctness of the result output by the program was found violated |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
5.2.2.
Examples
mcnemasc(0.05,50,0.20,0.05,0.0005,5)
Exact rejection probability of the asymptotic test for equivalence of two paired binomial proportions with respect to the difference of their expectations (McNemar setting)
Description
The program computes exact values of the rejection probability of the asymptotic
test for equivalence in the sense of -\delta_0 < p_{10}-p_{01} < \delta_0
, at any nominal
level \alpha
. [The largest \alpha
for which the test is valid in terms of the
significance level, can be computed by means of the program mcnemasc.]
Usage
mcnempow(alpha,n,del0,p10,p01)
Arguments
alpha |
nominal significance level |
n |
sample size |
del0 |
upper limit set to |
p10 |
true value of |
p01 |
true value of |
Value
alpha |
nominal significance level |
n |
sample size |
del0 |
upper limit set to |
p10 |
true value of |
p01 |
true value of |
POW |
exact rejection probability of the asymptotic McNemar test for equivalence
at nominal level |
ERROR |
error indicator messaging "!!!!!" if the sufficient condition for the correctness of the result output by the program was found violated |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, p.84.
Examples
mcnempow(0.024902,50,0.20,0.30,0.30)
Analogue of mwtie_xy for settings with grouped data
Description
Implementation of the asymptotically distribution-free test for equivalence of discrete distributions from which grouped data are obtained. Hypothesis formulation is in terms of the Mann-Whitney-Wilcoxon functional generalized to the case that ties between observations from different distributions may occur with positive probability. For details see Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition, p.155.
Usage
mwtie_fr(k,alpha,m,n,eps1_,eps2_,x,y)
Arguments
k |
total number of grouped values which can be distinguished in the pooled sample |
alpha |
significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
eps1_ |
absolute value of the left-hand limit of the hypothetical equivalence range for
|
eps2_ |
right-hand limit of the hypothetical equivalence range for |
x |
row vector with the |
y |
row vector with the |
Details
Notation: \pi_+
and \pi_0
stands for the functional defined by \pi_+ = P[X>Y]
and
\pi_0 = P[X=Y]
, respectively,
with X\sim F \equiv
cdf of Population 1 being independent of Y\sim G \equiv
cdf of Population 2.
Value
alpha |
significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
eps1_ |
absolute value of the left-hand limit of the hypothetical equivalence range for
|
eps2_ |
right-hand limit of the hypothetical equivalence range for |
WXY_TIE |
observed value of the |
SIGMAH |
square root of the estimated asymtotic variance of |
CRIT |
upper critical bound to |
REJ |
indicator of a positive [=1] vs negative [=0] rejection decision to be taken with the data under analysis |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S, Hampel B: A distribution-free two-sample equivalence test allowing for tied observations. Biometrical Journal 41 (1999), 171-186.
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.4.
Examples
x <- c(1,1,3,2,2,3,1,1,1,2,1,2,2,2,1,2,1,3,2,1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,3,1,3,2,1,1,
2,1,2,1,1,2,2,1,2,1,1,1,1,1,2,2,1,2,2,1,3,1,2,1,1,2,2,1,2,2,1,1,1,3,2,1,1,1,2,1,
3,3,3,1,2,1,2,2,1,1,1,2,2,1,1,2,1,1,2,3,1,3,2,1,1,1,1,2,2,2,1,1,2,2,3,2,1,2,1,1,
2,2,1,2,2,2,1,1,2,3,2,1,3,2,1,1,1,2,2,2,2,1,2,2,1,1,1,1,2,1,1,1,2,1,2,2,1,2,2,2,
2,1,1,2,1,2,2,1,1,1,1,3,1,1,2,2,1,1,1,2,2,2,1,2,3,2,2,1,2,1,2,1,1,2,1,2,2,1,1,1,
2,2,2,2)
y <- c(2,1,2,2,1,1,2,2,2,1,1,2,1,3,3,1,1,1,1,1,1,2,2,3,1,1,1,3,1,1,1,1,1,1,1,2,2,3,2,1,
2,2,2,1,2,1,1,2,2,1,2,1,1,1,1,2,1,2,1,1,3,1,1,1,2,2,2,1,1,1,1,2,1,2,1,1,2,2,2,2,
2,1,1,1,3,2,2,2,1,2,3,1,2,1,1,1,2,1,3,3,1,2,2,2,2,2,2,1,2,1,1,1,1,2,2,1,1,1,1,2,
1,3,1,1,2,1,2,1,2,2,2,1,2,2,2,1,1,1,2,1,2,1,2,1,1,1,2,1,2,2,1,1,1,1,2,2,3,1,3,1,
1,2,2,2,1,1,1,1,2,1,1,3,2,2,3,1,2,2,1,1,2,1,1,2,1,2,2,1,2,1,2,2,2,1,1,1,1,1,1,1,
1,1,1,2,1,3,2,2,1,1,1,2,2,1,1,2,1,2,1,2,2,2,1,2,3,1,1,2,1,2,2,1,1,1,1,2,2,2,1,1,
3,2,1,2,2,2,1,1,1,2,1,2,2,1,2,1,1,2)
mwtie_fr(3,0.05,204,258,0.10,0.10,x,y)
Distribution-free two-sample equivalence test for tied data: test statistic and critical upper bound
Description
Implementation of the asymptotically distribution-free test for
equivalence of discrete distributions in terms of the Mann-Whitney-Wilcoxon functional
generalized to the case that ties between observations from different distributions may
occur with positive probability. For details see Wellek S (2010) Testing statistical hypotheses of
equivalence and noninferiority. Second edition, \S
6.4.
Usage
mwtie_xy(alpha,m,n,eps1_,eps2_,x,y)
Arguments
alpha |
significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
eps1_ |
absolute value of the left-hand limit of the hypothetical equivalence range for
|
eps2_ |
right-hand limit of the hypothetical equivalence range for |
x |
row vector with the |
y |
row vector with the |
Details
Notation: \pi_+
and \pi_0
stands for the functional defined by \pi_+ = P[X>Y]
and
\pi_0 = P[X=Y]
, respectively,
with X\sim F \equiv
cdf of Population 1 being independent of Y\sim G \equiv
cdf of Population 2.
Value
alpha |
significance level |
m |
size of Sample 1 |
n |
size of Sample 2 |
eps1_ |
absolute value of the left-hand limit of the hypothetical equivalence range for
|
eps2_ |
right-hand limit of the hypothetical equivalence range for |
WXY_TIE |
observed value of the |
SIGMAH |
square root of the estimated asymtotic variance of |
CRIT |
upper critical bound to |
REJ |
indicator of a positive [=1] vs negative [=0] rejection decision to be taken with the data under analysis |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S, Hampel B: A distribution-free two-sample equivalence test allowing for tied observations. Biometrical Journal 41 (1999), 171-186.
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.4.
Examples
x <- c(1,1,3,2,2,3,1,1,1,2)
y <- c(2,1,2,2,1,1,2,2,2,1,1,2)
mwtie_xy(0.05,10,12,0.10,0.10,x,y)
Bayesian posterior probability of the alternative hypothesis of probability-based individual bioequivalence (PBIBE)
Description
Implementation of the algorithm presented in \S
10.3.3 of
Wellek S (2010) Testing statistical hypotheses of equivalence and
noninferiority. Second edition.
Usage
po_pbibe(n,eps,pio,zq,s,tol,sw,ihmax)
Arguments
n |
sample size |
eps |
equivalence margin to an individual log-bioavailability ratio |
pio |
prespecified lower bound to the probability of obtaining an individual
log-bioavailability ratio falling in the equivalence range |
zq |
mean log-bioavailability ratio observed in the sample under analysis |
s |
square root of the sample variance of the log-bioavailability ratios |
tol |
maximum numerical error allowed for transforming the hypothesis of PBIBE into a region in the parameter space of the log-normal distribution assumed to underlie the given sample of individual bioavailability ratios |
sw |
step width used in the numerical procedure yielding results at a level of accuracy specified by the value chosen for tol |
ihmax |
maximum number of interval halving steps to be carried out in finding the region specified in the parameter space according to the criterion of PBIBE |
Details
The program uses 96-point Gauss-Legendre quadrature.
Value
n |
sample size |
eps |
equivalence margin to an individual log-bioavailability ratio |
pio |
prespecified lower bound to the probability of obtaining an individual
log-bioavailability ratio falling in the equivalence range |
zq |
mean log-bioavailability ratio observed in the sample under analysis |
s |
square root of the sample variance of the log-bioavailability ratios |
tol |
maximum numerical error allowed for transforming the hypothesis of PBIBE into a region in the parameter space of the log-normal distribution assumed to underlie the given sample of individual bioavailability ratios |
sw |
step width used in the numerical procedure yielding results at a level of accuracy specified by the value chosen for tol |
ihmax |
maximum number of interval halving steps to be carried out in finding the region specified in the parameter space according to the criterion of PBIBE |
PO_PBIBE |
posterior probability of the alternative hypothesis of PBIBE |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Bayesian construction of an improved parametric test for probability-based individual bioequivalence. Biometrical Journal 42 (2000), 1039-52.
Wellek S: Testing statistical hypotheses of equivalence and
noninferiority. Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, \S
10.3.3.
Examples
po_pbibe(20,0.25,0.75,0.17451,0.04169, 10e-10,0.01,100)
Bayesian posterior probability of the alternative hypothesis in the setting of the one-sample t-test for equivalence
Description
Evaluation of the integral appearing on the right-hand side of equation (3.6) on p. 38 of Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition
Usage
postmys(n,dq,sd,eps1,eps2,tol)
Arguments
n |
sample size |
dq |
mean within-pair difference observed in the sample under analysis |
sd |
square root of the sample variance of the within-pair differences |
eps1 |
absolute value of the left-hand limit of the hypothetical equivalence range
for |
eps2 |
right-hand limit of the hypothetical equivalence range for |
tol |
tolerance for the error induced through truncating the range of integration on the right |
Details
The program uses 96-point Gauss-Legendre quadrature.
Value
n |
sample size |
dq |
mean within-pair difference observed in the sample under analysis |
sd |
square root of the sample variance of the within-pair differences |
eps1 |
absolute value of the left-hand limit of the hypothetical equivalence range
for |
eps2 |
right-hand limit of the hypothetical equivalence range for |
tol |
tolerance for the error induced through truncating the range of integration on the right |
PPOST |
posterior probability of the set of all |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and
noninferiority. Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, \S
3.2.
Examples
postmys(23,0.16,3.99,0.5,0.5,1e-6)
Confidence innterval inclusion test for average bioequivalence: exact power against an arbitrary specific alternative
Description
Evaluation of the integral on the right-hand side of equation (10.11) of p. 317 of Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition
Usage
pow_abe(m,n,alpha,del_0,del,sig)
Arguments
m |
sample size in sequence group T(est)/R(eference) |
n |
sample size in sequence group R(eference)/T(est) |
alpha |
significance level |
del_0 |
equivalence margin to the absolute value of the log-ratio |
del |
assumed true value of |
sig |
theoretical standard deviation of the log within-subject bioavailability ratios in each sequence group |
Details
The program uses 96-point Gauss-Legendre quadrature.
Value
m |
sample size in sequence group T(est)/R(eference) |
n |
sample size in sequence group R(eference)/T(est) |
alpha |
significance level |
del_0 |
equivalence margin to the absolute value of the log-ratio |
del |
assumed true value of |
POW_ABE |
power of the interval inclusion test for average bioequivalence against the
specific alternative given by |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and
noninferiority. Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, \S
10.2.1.
Examples
pow_abe(12,13,0.05,log(1.25),log(1.25)/2,0.175624)
Nonconditional power of the UMPU sign test for equivalence and its nonrandomized counterpart
Description
The program computes for each possible value of the number n_0
of
zero observations the power conditional on N_0 = n_0
and averages
these conditional power values with respect to the distribution of N_0
.
Equivalence is defined in terms of the logarithm of the ratio p_+/p_-
, where
p_+
and p_-
denotes the probability of obtaining a positive and negative
sign, respectively.
Usage
powsign(alpha,n,eps1,eps2,poa)
Arguments
alpha |
significance level |
n |
sample size |
eps1 |
absolute value of the lower limit of the hypothetical equivalence range for
|
eps2 |
upper limit of the hypothetical equivalence range for |
poa |
probability of a tie under the alternative of interest |
Value
alpha |
significance level |
n |
sample size |
eps1 |
absolute value of the lower limit of the hypothetical equivalence range for
|
eps2 |
upper limit of the hypothetical equivalence range for |
poa |
probability of a tie under the alternative of interest |
POWNONRD |
power of the nonrandomized version of the test against the alternative
|
POW |
power of the randomized UMPU test against the alternative
|
Note
A special case of the test whose power is computed by this program, is the exact conditional equivalence test for the McNemar setting (cf. Wellek 2010, pp. 76-77).
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
5.1.
Examples
powsign(0.06580,50,0.847298,0.847298,0.26)
Signed rank test for equivalence of an arbitrary continuous distribution of the intraindividual differences in terms of the probability of a positive sign of a Walsh average: test statistic and critical upper bound
Description
Implementation of the paired-data analogue of the Mann-Whitney-Wilcoxon test for
equivalence of continuous distributions. The continuity assumption relates to the
intraindividual differences D_i
. For details see Wellek S (2010) Testing statistical
hypotheses of equivalence and noninferiority. Second edition,\S
5.4.
Usage
sgnrk(alpha,n,qpl1,qpl2,d)
Arguments
alpha |
significance level |
n |
sample size |
qpl1 |
lower equivalence limit |
qpl2 |
upper equivalence limit |
d |
row vector with the intraindividual differences for all |
Details
q_+
is the probability of getting a positive sign of the so-called Walsh-average
of a pair of within-subject differences and can be viewed as a natural paired-observations
analogue of the Mann-Whitney functional \pi_+ = P[X>Y]
.
Value
alpha |
significance level |
n |
sample size |
qpl1 |
lower equivalence limit |
qpl2 |
upper equivalence limit |
U_pl |
observed value of the |
SIGMAH |
square root of the estimated asymtotic variance of |
CRIT |
upper critical bound to |
REJ |
indicator of a positive [=1] vs negative [=0] rejection decision to be taken with the data under analysis |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
5.4.
Examples
d <- c(-0.5,0.333,0.667,1.333,1.5,-2.0,-1.0,-0.167,1.667,0.833,-2.167,-1.833,
4.5,-7.5,2.667,3.333,-4.167,5.667,2.333,-2.5)
sgnrk(0.05,20,0.2398,0.7602,d)
Generalized signed rank test for equivalence for tied data: test statistic and critical upper bound
Description
Implementation of a generalized version of the signed-rank test for equivalence
allowing for arbitrary patterns of ties between the within-subject differences.
For details see Wellek S (2010) Testing statistical hypotheses of equivalence and
noninferiority. Second edition, \S
5.5.
Usage
srktie_d(n,alpha,eps1,eps2,d)
Arguments
n |
sample size |
alpha |
significance level |
eps1 |
absolute value of the left-hand limit of the hypothetical equivalence range for
|
eps2 |
right-hand limit of the hypothetical equivalence range for |
d |
row vector with the intraindividual differences for all |
Details
Notation: q_+
and q_0
stands for the functional defined by
q_+ = P[D_i+D_j>0]
and q_0 = P[D_i+D_j=0]
, respectively,
with D_i
and D_j
as the intraindividual differences observed in two individuals
independently selected from the underlying bivariate population.
Value
n |
sample size |
alpha |
significance level |
eps1 |
absolute value of the left-hand limit of the hypothetical equivalence range for
|
eps2 |
right-hand limit of the hypothetical equivalence range for |
U_pl |
observed value of the |
U_0 |
observed value of the |
UAS_PL |
observed value of |
TAUHAS |
square root of the estimated asymtotic variance of |
CRIT |
upper critical bound to |
REJ |
indicator of a positive [=1] vs negative [=0] rejection decision to be taken with the data under analysis |
Note
The function srktie_d can be viewed as the paired-data analogue of mwtie_xy
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
5.5.
Examples
d <- c(0.8,0.2,0.0,-0.1,-0.3,0.3,-0.1,0.4,0.6,0.2,0.0,-0.2,-0.3,0.0,0.1,0.3,-0.3,
0.1,-0.2,-0.5,0.2,-0.1,0.2,-0.1)
srktie_d(24,0.05,0.2602,0.2602,d)
Analogue of srktie_d for settings where the distribution of intraindividual differences is concentrated on a finite lattice
Description
Analogue of the function srktie_d tailored for settings where the distribution of the within-subject differences is concentrated on a finite lattice. For details see Wellek S (2010) Testing statistical hypotheses of equivalence and noninferiority. Second edition, pp.112-3.
Usage
srktie_m(n,alpha,eps1,eps2,w,d)
Arguments
n |
sample size |
alpha |
significance level |
eps1 |
absolute value of the left-hand limit of the hypothetical equivalence range for
|
eps2 |
right-hand limit of the hypothetical equivalence range for |
w |
span of the lattice in which the intraindividual differences take their values |
d |
row vector with the intraindividual differences for all |
Details
Notation: q_+
and q_0
stands for the functional defined by
q_+ = P[D_i+D_j>0]
and q_0 = P[D_i+D_j=0]
, respectively,
with D_i
and D_j
as the intraindividual differences observed in two individuals
independently selected from the underlying bivariate population.
Value
n |
sample size |
alpha |
significance level |
eps1 |
absolute value of the left-hand limit of the hypothetical equivalence range for
|
eps2 |
right-hand limit of the hypothetical equivalence range for |
w |
span of the lattice in which the intraindividual differences take their values |
U_pl |
observed value of the |
U_0 |
observed value of the |
UAS_PL |
observed value of |
TAUHAS |
square root of the estimated asymtotic variance of |
CRIT |
upper critical bound to |
REJ |
indicator of a positive [=1] vs negative [=0] rejection decision to be taken with the data under analysis |
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition. Boca Raton: Chapman & Hall/CRC Press, 2010, pp. 112-114.
Examples
d <- c(0.8,0.2,0.0,-0.1,-0.3,0.3,-0.1,0.4,0.6,0.2,0.0,-0.2,-0.3,0.0,0.1,0.3,-0.3,
0.1,-0.2,-0.5,0.2,-0.1,0.2,-0.1)
srktie_m(24,0.05,0.2602,0.2602,0.1,d)
Critical constants and power against the null alternative of the one-sample t-test for equivalence with an arbitrary, maybe nonsymmetric choice of the limits of the equivalence range
Description
The function computes the critical constants defining the uniformly most powerful
invariant test for the problem
\delta/\sigma_D \le \theta_1
or \delta/\sigma_D \ge \theta_2
versus \theta_1 < \delta/\sigma_D < \theta_2
, with (\theta_1,\theta_2)
as a
fixed nondegenerate interval on the real line.
In addition, tt1st outputs the power against the null alternative \delta = 0
.
Usage
tt1st(n,alpha,theta1,theta2,tol,itmax)
Arguments
n |
sample size |
alpha |
significance level |
theta1 |
lower equivalence limit to |
theta2 |
upper equivalence limit to |
tol |
tolerable deviation from |
itmax |
maximum number of iteration steps |
Value
n |
sample size |
alpha |
significance level |
theta1 |
lower equivalence limit to |
theta2 |
upper equivalence limit to |
IT |
number of iteration steps performed until reaching the stopping criterion corresponding to TOL |
C1 |
left-hand limit of the critical interval for the one-sample |
C2 |
right-hand limit of the critical interval for the one-sample |
ERR1 |
deviation of the rejection probability from |
ERR2 |
deviation of the rejection probability from |
POW0 |
power of the UMPI test against the alternative |
Note
If the output value of ERR2 is NA, the deviation of the rejection probability at the right-hand
boundary of the hypothetical equivalence interval from \alpha
is smaller than the smallest
real number representable in R.
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
5.3.
Examples
tt1st(36,0.05, -0.4716,0.3853,1e-10,50)
Critical constants and power against the null alternative of the two-sample t-test for equivalence with an arbitrary, maybe nonsymmetric choice of the limits of the equivalence range
Description
The function computes the critical constants defining the uniformly most powerful
invariant test for the problem
(\xi-\eta)/\sigma \le -\varepsilon_1
or (\xi-\eta)/\sigma \ge \varepsilon_2
versus -\varepsilon_1 < (\xi-\eta)/\sigma < \varepsilon_2
, with \xi
and \eta
denoting
the expected values of two normal distributions with common variance \sigma^2
from which independent
samples are taken.
In addition, tt2st outputs the power against the null alternative \xi = \eta
.
Usage
tt2st(m,n,alpha,eps1,eps2,tol,itmax)
Arguments
m |
size of the sample from |
n |
size of the sample from |
alpha |
significance level |
eps1 |
absolute value of the lower equivalence limit to |
eps2 |
upper equivalence limit to |
tol |
tolerable deviation from |
itmax |
maximum number of iteration steps |
Value
m |
size of the sample from |
n |
size of the sample from |
alpha |
significance level |
eps1 |
absolute value of the lower equivalence limit to |
eps2 |
upper equivalence limit to |
IT |
number of iteration steps performed until reaching the stopping criterion corresponding to TOL |
C1 |
left-hand limit of the critical interval for the two-sample |
C2 |
right-hand limit of the critical interval for the two-sample |
ERR1 |
deviation of the rejection probability from |
ERR2 |
deviation of the rejection probability from |
POW0 |
power of the UMPI test against the alternative |
Note
If the output value of ERR2 is NA, the deviation of the rejection probability at the right-hand
boundary of the hypothetical equivalence interval from \alpha
is smaller than the smallest
real number representable in R.
Author(s)
Stefan Wellek <stefan.wellek@zi-mannheim.de>
Peter Ziegler <peter.ziegler@zi-mannheim.de>
References
Wellek S: Testing statistical hypotheses of equivalence and noninferiority. Second edition.
Boca Raton: Chapman & Hall/CRC Press, 2010, \S
6.1.
Examples
tt2st(12,12,0.05,0.50,1.00,1e-10,50)