test_RD: Calculate RD test statistic

Description Usage Arguments Details Value Examples

View source: R/Non_Inferiority_RD_RR.R

Description

test_RD returns the value of the Farrington-Manning test statistic for non-inferiority of the risk difference between two proportions.

Usage

1
test_RD(x_E, x_C, n_E, n_C, delta, better = c("high", "low"))

Arguments

x_E

Vector of number of events in experimental group.

x_C

Vector of number of events in control group.

n_E

Sample size in experimental group.

n_C

Sample size in control group.

delta

Non-inferiority margin.

better

"high" if higher values of \mjseqnx_E favour the alternative hypothesis and "low" vice versa.

Details

If higher values of \mjseqnx_E favour the alternative hypothesis, we are interested in testing the null hypothesis \mjsdeqnH_0: p_E - p_C \le \delta , where the NI-margin is usually non-positive: \mjseqn\delta \le 0. The test statistic for this hypothesis is \mjsdeqnT_\RD, \delta(x_E, x_C) = \frac\hat p_E - \hat p_C - \delta\sqrt\frac\tilde p_E(1 - \tilde p_E)n_E + \frac\tilde p_C(1 - \tilde p_C)n_C, where \mjseqn\tilde p_C = \tilde p_C(x_E, x_C) is the MLE of \mjseqnp_C and \mjseqn\tilde p_E = \tilde p_C + \delta is the MLE of \mjseqnp_E under \mjseqnp_E - p_C = \delta. High values of \mjseqnT_\RD, \delta favour the alternative hypothesis.

Value

Vector of values of the RD test statistic.

Examples

1
test_RD(3, 4, 10, 10, 0.2, "high")

s-kilian/binary documentation built on Sept. 26, 2021, 6:28 p.m.