Package 'MIDN'

Title: Nearly Exact Sample Size Calculation for Exact Powerful Nonrandomized Tests for Differences Between Binomial Proportions
Description: Implementation of the mid-n algorithms presented in Wellek S (2015) <DOI:10.1111/stan.12063> Statistica Neerlandica 69, 358-373 for exact sample size calculation for superiority trials with binary outcome.
Authors: Stefan Wellek, Peter Ziegler
Maintainer: Peter Ziegler <[email protected]>
License: CC0
Version: 1.0
Built: 2024-11-13 06:26:18 UTC
Source: CRAN

Help Index


Nearly exact sample size calculation for exact powerful nonrandomized tests for differences between binomial proportions

Description

Implementation of the mid-n algorithms presented in Wellek S (2015) Statistica Neerlandica 69, 358-373 for exact sample size calculation for superiority trials with binary outcome.

Author(s)

Stefan Wellek <[email protected]>
Peter Ziegler <[email protected]>

Maintainer:
Peter Ziegler <[email protected]>

References

Wellek S: Nearly exact sample size calculation for powerful nonrandomized tests for differences between binomial proportions. Statistica Neerlandica 69 (2015), 358-373.

Examples

result1 <- fisher_boschloo_midN(0.025,0.0001,0.95,0.8,0.8,2,1)
POWEX <- result1[5]
result1  # shows values of vector result1
POWEX    # shows value of POWEX

result2 <- McNem_Score_midn(0.025,0.0001,0.585,0.315,0.9)
POWEX <- result2[3]
result2  # shows values of vector result2
POWEX    # shows value of POWEX

Nearly exact sample size calculation for the Fisher-Boschloo test for differences between independent binomial proportions

Description

The function computes the exact sample sizes required in the randomized UMPU test and its conservative nonrandomized version for attaining prespecified power. In a final step, the mean of both quantities is output as an nearly exact value required in the Fisher-Boschloo test, a powerful nonrandomized version of the exact Fisher-type test.

Usage

fisher_boschloo_midN(alpha, SW, p1, p2, POWO, mton_a, mton_b)

Arguments

alpha

target significance level

SW

step width for increasing p2 in the search for the size of a given critical region in the sample space of (X,Y)

p1

true value of the responder rate for Population 1

p2

true value of the responder rate for Population 2

POWO

power to be obtained against the alternative (p1,p2)

mton_a

desired ratio of sample sizes: numerator

mton_b

desired ratio of sample sizes: denominator

Value

mstart

initial value of 1st sample size

nstart

initial value of 2nd sample size

Mex

size of Sample 1 for randomized UMPU test

Nex

size of Sample 2 for randomized UMPU test

POWEX

power of randomized UMPU test attained with m=Mex,n=Nex

Mnr

size of Sample 1 for conservative nonrandomized Fisher-type test

Nnr

size of Sample 2 for conservative nonrandomized Fisher-type test

POWNR

power of conservative nonrandomized Fisher-type test attained with m=Mnr,n=Nnr

midN_m

nearly exact size of Sample 1 for Boschloo-Fisher test

midN_n

nearly exact size of Sample 1 for Boschloo-Fisher test

Author(s)

Stefan Wellek <[email protected]>
Peter Ziegler <[email protected]>

References

Wellek S: Nearly exact sample size calculation for powerful nonrandomized tests for differences between binomial proportions. Statistica Neerlandica 69 (2015), 358-373.

Examples

result1 <- fisher_boschloo_midN(0.025,0.0001,0.95,0.8,0.8,2,1)
POWEX <- result1[5]
result1  # shows values of vector result1
POWEX    # shows value of POWEX

Nearly exact sample size calculation for the level-corrected score test for differences between binomial proportions estimated from paired data

Description

Again, the function computes the exact sample sizes required in the randomized UMPU test and its conservative nonrandomized counterepart for attaining prespecified power. However, in contrast to the parallel group setting, the midpoint of the interval between these two numbers shall now used as an nearly exact value of the number of pairs to be observed in the asymptotic test based on the score-statistic corrected for possible exceedances of the nominal significance level.

Usage

McNem_Score_midn(alpha, SW, ppl, pmi, POWO)

Arguments

alpha

target significance level, 1-sided

SW

width of search grid for determining the size of a given critical region in the sample space of N+ [= number of pairs with (Xi,Yi) = (1,0)] and N0 [= number of tied pairs]

ppl

true value of Pr[(X,Y) = (1,0)]

pmi

true value of Pr[(X,Y) = (0,1)]

POWO

power to be attained in the level-corrected score test against the alternative (ppl,pmi)

Value

nstart

initial value for the iteration algorithm

Nex

sample size required in the exact randomized McNemar test

POWEX

power of the exact randomized McNemar test performed with Nex pairs

Nnr

sample size required in the conservative nonrandomized McNemar test

POWNR

power of the nonrandomized McNemar test performed with Nnr pairs

mid_n

midpoint of the interval [Nex,Nnr], rounded to the next integer

Author(s)

Stefan Wellek <[email protected]>
Peter Ziegler <[email protected]>

References

Wellek S: Nearly exact sample size calculation for powerful nonrandomized tests for differences between binomial proportions. Statistica Neerlandica 69 (2015), 358-373.

Examples

result2 <- McNem_Score_midn(0.025,0.0001,0.585,0.315,0.9)
POWEX <- result2[3]
result2  # shows values of vector result2
POWEX    # shows value of POWEX