Rohmel and Keier (2013) developed these non-inferioirty tests with variable margins. One margin function, NiM3, has the variable margin measuring a constant difference in proportions (0.10 in paper) after a threshold (0.20 proportion in the control group), or tests for differences defined in terms of a constant odds ratio (1.71 in paper) at values less than the threshold. The fmecTest
with type='max' gives the maximum of two p-values, either a difference in proportions test (one-sided asymptotic method of Farrington and Manning, 1990) or an odds ratio test (one-sided Fisher's exact). This test is NiM3/T2 in Rohmel and Keier (2013). We also provide an exact version of this test with fmecExact
, denoted NiM3/T3 in Rohmel and Keier (2013). When type='switch' the tests are like T1 of Rohmel and Keier (2013).
fmecTest(x1, n1, x2, n2, threshold = 0.2, delta = 0.1,
alternative = c("less","greater"),
type = c("max", "switch"))fmecExact(x1, n1, x2, n2, threshold = 0.2, delta = 0.1,
alternative = c("less", "greater"),
type = c("max", "switch"), ngrid = 1000)
a list of class 'htest':
the threshold, delta (difference margin at threshold), and odds ratio at threshold
gives x1,x2,n1,n2 as a character string
description of test
one-sided p-value
delta, the difference margin at threshold
direction of alternative hypothesis
number of failures in control group
number of individuals in control group
number of failures in test group
number of individuals in test group
threshold on proportion in control group: above it use constant difference margin, below it use difference margin with constant odds ratio
difference margin at threshold
must be 'less'. the value 'greater' is not supported at this time.
either 'max' (maximum of Fisher's exact p-value or Farrington and Manning p-value) or 'switch' (Fisher's exact p-value below threhold and Farington and Manning p-value above threhold).
grid size for the search for the maximum p-value. Search over the control proportion values 0:ngrid/ngrid.
Michael P. Fay
For details see Rohmel and Keier (2013, Section 3). These functions only use NiM3.
Farrington, CP and Manning G (1990). "Test statistics and sample size formulae for comparative binomial trials with null hypothesis of non-zero risk difference or non-unit relative risk" Statistics in Medicine 9:1447-1454.
Rohmel, J, and Kieser, M (2013). "Investigations on non-inferiority - - the Food and Drug Administration draft guidance on treatments for nosocomial pneumonia as a case for exact tests for binomial proportions" Statistics in Medicine 32:2335-2348.
nicqTest
fmecTest(6,10,2,12,alternative="less",type="max")
fmecExact(6,10,2,12,alternative="less",type="max")
Run the code above in your browser using DataLab