View source: R/farrington-manning.R
farrington_manning_n | R Documentation |
Farrington-Manning sample size calculation
farrington_manning_n(
p1,
p2,
theta,
delta = NULL,
r0 = NULL,
metric = "riskdiff",
alpha = 0.05,
beta = 0.2,
alternative = "greater"
)
p1 |
response probability in group 1 |
p2 |
response probability in group 2 |
theta |
randomization ratio (in the form of N2/N1) |
delta |
the non-inferiority margin for risk difference under the null |
r0 |
the non-inferiority margin for the relative risk under the null |
metric |
specifying the metric used to construct the test statistic,
|
alpha |
type 1 error control |
beta |
1- power |
alternative |
taking value of either |
this function is an implementation of Eq.(4) in Farrington &
Manning, 1990 paper. The sample size calculation is based on \hat{p}_1
- \hat{p}_2 - \delta
, and the test has form
H_0: p_1 - p_2 >=\delta VS H_1: p_1-p_2 < \delta
,
based on maximum likelihood estimation (Method 3 of that paper) under the
null hypothesis restriction p1_tilt - p2_tilt = delta
p10:group 1 proportion tested by the null
delta:non-inferiority margin
p1:binomial proportions = n11/n1
p2:binomial proportions = n21/n2
p:overall proportion = m1/n
test H0: p10 - p2 >= delta vs H1: p10 - p2 < delta
Other forms of hypothesis test are also available. For more details please refer to the paper.
a table with sample size for each arm, and p1_tilt, p2_tilt that estimate p1 and p2 under the null hypothesis.
farrington1990testr4ct
# reproducing first row of Table 1 in that paper
farrington_manning_n(p1 = 0.1, p2 = 0.1, r0 = 0.1, theta = 2/3,
metric = "relrisk", alpha = 0.05, beta = 0.1)
farrington_manning_n(p1 = 0.1, p2 = 0.1, delta = -0.2, theta = 2/3,
metric = "riskdiff", alpha = 0.05, beta = 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.