farrington_manning_n: Farrington-Manning sample size calculation

View source: R/farrington-manning.R

farrington_manning_nR Documentation

Farrington-Manning sample size calculation

Description

Farrington-Manning sample size calculation

Usage

farrington_manning_n(
  p1,
  p2,
  theta,
  delta = NULL,
  r0 = NULL,
  metric = "riskdiff",
  alpha = 0.05,
  beta = 0.2,
  alternative = "greater"
)

Arguments

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, riskdiff for testing of risk difference (p1-p2) and relriks for testing relative risk (R = p1/p2)

alpha

type 1 error control

beta

1- power

alternative

taking value of either greater for delta <= delta0 vs delta > delta0 or two.sided for delta = delta0 vs delta != delta0. Similar for testing relative risk

Details

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.

Value

a table with sample size for each arm, and p1_tilt, p2_tilt that estimate p1 and p2 under the null hypothesis.

References

\insertRef

farrington1990testr4ct

Examples

# 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)

zhuob/R4ClinicalTrial documentation built on Feb. 4, 2025, 1:15 a.m.