Unstratified and Stratified Miettinen and Nurminen Test
Source:vignettes/rate-compare.Rmd
rate-compare.Rmd
Overview
Binary outcome is a commonly used endpoint in clinical trials. This
page illustrates how to conduct the unstratified or stratified analysis
with the Miettinen and Nurminen (M&N) method (Miettinen and Nurminen 1985) for risk
difference analysis in R. The following statistics can be calculated
with the function rate_compare()
:
- Estimated risk difference.
- Test statistic.
- Confidence interval for the risk difference.
- p-value for risk difference.
Statistical methods
Unstratified analysis of M&N method
Assume the data includes two independent binomial samples with binary response variables to be analyzed/summarized and the data collected in a clinical design without stratification. Also this approach is applicable to the case when the data are collected using a stratified clinical design and the statistician would like to ignore stratification by pooling the data over strata assuming two independent binomial samples. Assume is the proportion of success responses in the test () or control () group.
Confidence interval
The confidence interval is based on the M&N method and given by the roots for of the equation:
,
where and are the observed values of and , respectively;
= the upper cut point of size from the central chi-square distribution with 1 degree of freedom ( for % confidence interval);
= the difference between two population proportions ();
;
and are the sample sizes for the test and control group, respectively;
= maximum likelihood estimate of proportion on test computed as ;
= maximum likelihood estimate of proportion on control under the constraint .
As stated above the 2-sided % CI is given by the roots for . The bisection algorithm is used in the function to obtain the two roots (confidence interval) for .
p-value and Z-statistic
The Z-statistic is computed as:
where and are the observed values for and respectively, is pre-specified proportion difference under the null;
= maximum likelihood estimate of proportion on test computed as ;
= maximum likelihood estimate of proportion on control under the constraint .
For non-inferiority or one-sided equivalence hypothesis with , the p-value, , is computed based on using the standard normal distribution.
For non-inferiority or one-sided equivalence hypothesis with , the p-value, , is computed based on using the standard normal distribution.
For two-sided superiority test, the p-value , is computed based on using the chi-square distribution with 1 degree of freedom, where .
Stratified analysis of M&N method
Assume the data includes two treatment groups, test and control, and collected based on a stratified design. Within each stratum there are two independent binomial samples with binary response variables to be analyzed/summarized. The parameter of interest is the difference between the population proportions of the test and the control groups. The analysis and summaries need to be performed while adjusting for the stratifying variables.
Confidence interval
The confidence interval is based on the M&N method and given by the roots for of the equation:
,
where for ;
;
- is the weight for the -th strata;
- $I = K = $ number of strata, strata;
- and are the sample sizes in -th strata for the test and control group, respectively;
- and = observed proportion in -th strata for the test and control, respectively;
- and are MLE for and , respectively, computed under the constraint .
Similarly as for unstratified analysis,the 2-sided % CI is given by the roots for , and the bisection algorithm is used in the function to obtain the two roots (confidence interval) for .
Example
Data simulation
We simulated a dataset with 2 treatment group for binary output. If stratum is used, we considered 4 stratum.
Unstratified analysis
The function computes the risk difference, Z-statistic, p-value given the type of test, and two-sided % confidence interval of difference between two rates.
rate_compare(response ~ treatment, data = ana)
#> est z_score p lower upper
#> 1 0.4 5.759051 4.229411e-09 0.269662 0.5165743
Stratified analysis
The sample size weighting is often used in the clinical trial. Below is the function to conduct stratified MN analysis with sample size weights.
We also support weight in "equal"
and
"cmh"
. More details can be found in the
rate_compare()
documentation.
rate_compare(
formula = response ~ treatment, strata = stratum, data = ana,
weight = "ss"
)
#> est z_score p lower upper
#> 1 0.3998397 5.712797 5.556727e-09 0.2684383 0.5172779