Description Usage Arguments Details Value Examples
View source: R/Non_Inferiority_RD_RR.R
test_RD
returns the value of the Farrington-Manning test statistic
for non-inferiority of the risk difference between two proportions.
1 |
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. |
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.
Vector of values of the RD test statistic.
1 | test_RD(3, 4, 10, 10, 0.2, "high")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.