Hypostis testing
Binomial Non-inferiority Two-Sample Testing
Let πc and πt denote the response rates for the control and experimental treatments, respectively. Higher response rate means better performance. Let δ=πt−πc. We have
H0:δ≤δ0vsH1:δ>δ0 where δ0<0 is called non-inferiority margin. In other word,
H0:πt≤πc+δ0vsH1:πt>πc+δ0 The test statistic can be defined by
T=ˆπt−ˆπc−δ0√˜πt(1−˜πt)nt+˜πc(1−˜πc)nc where ˜πt and ˜πc are the restricted maximum likelihood estimates (REML) of πt and πc. From Miettinen and Nurminen (1985), ˜πt and ˜πc can be obtained by solving the third degree likelihood equation:
3∑k=0Lk˜πkc=0 with ˜πt=˜πc+δ0,
L3=N=nc+ntL2=(nt+2nc)δ0−N−xc−xtL1=(ncδ0−N−2xc)δ0+xc+xtL0=xcδ0(1−δ0)
Cochran–Mantel–Haenszel statistics
In statistics, the Cochran–Mantel–Haenszel test (CMH) is a test used in the analysis of stratified or matched categorical data. It allows an investigator to test the association between a binary predictor or treatment and a binary outcome such as case or control status while taking into account the stratification
Treatment | Control | Row Total | |
---|---|---|---|
Event | xAj | xBj | x+j |
No Event | yAj | yBj | y−j |
Column Totals | nAj | nBj | Nj |
The risk ratio is ^RR=xA/x+yA/y− and the odds ratio = ^OR=xA/xByA/yB=xAyBxByA. The CMH estimate for a risk ratio is ^RRcmh=∑Kj=1xAj(yAj+yBj)/Nj∑Kj=1yAj(xAj+xBj)/Nj The CMH odds-ratio estimate is ^ORcmh=∑Kj=1xAjyBj/Nj∑Kj=1xBjyAj/Nj
The null hypothesis is that there is no association between the treatment and the outcome, i.e. H0:OR=1 and the alternative hypothesis is H1:OR≠1.
The test statistics is ξCMH=[∑Kj=1(xAj−x+jnAjNj)]2∑Kj=1x+jy−jnAjnBjN2j(Nj−1)∼χ21
i.e. ξCMH=[∑i(xAj−μAj)]2/∑iVar(xAj) where E(xAj)=x+jnAjNj and Var(xAj)=x+jy−jnAjnBjN2j(Nj−1).
Miettinen & Nurminen Method
Notation:Treatment | Control | Row Total | |
---|---|---|---|
Event | xAj | xBj | x+j |
No Event | yAj | yBj | y−j |
Column Totals | nAj | nBj | Nj |
The null hypothesis is a family of hypotheses: H(δ)=πAj−πBj=δ for j=1,…,K and the corresponding chi-square test statistics: ξMN(δ)=[∑Kj=1Wj(rAj−rBj−δ)]2∑Kj=1W2j˜VrAj−rBj∼χ21 where ˜VrAj−rBj={˜RAj(1−˜RAj)nAj+˜RBj(1−˜RBj)nBj}Nj(Nj−1) is the variance of dj=rAj−rBj under H(δ), ˜RAj and ˜RBj are the contrained maximum likelihood estimates of πAj and πBj so that ˜RAj−˜RBj=δ (see Miettinen & Nurminen Appendix 1), Wj is the M&N weight for stratum j:
Wj=[˜R∗A(1−˜R∗A)˜R∗B(1−˜R∗B)/nAj+1/nBj]−1,j=1,…,K
and ˜R∗A and ˜R∗B are the weighted averages of the contrained MLEs under H(δ), ˜R∗i=∑Kj=1Wj˜Rij∑Kj=1Wj,i=A,B.
We reject H(δ) if and only if ξMN(δ)≥χ21,1−α. The 100(1−α)% confidence limits of δ can be obtained by solving ξMN(ˆδL)=ξMN(ˆδU)=χ21,1−α We can also define Z(δ)=∑Kj=1Wj(rAj−rBj−δ)√∑Kj=1W2j˜VrAj−rBj so that Z(ˆδL)=z1−α/2 and Z(ˆδU)=−z1−α/2.
We can use the following steps to solve for the M&N weights:Implementation
ˆδ can be obtained through ˆδ=∑Kj=1Wj(rAj−rBj)∑Kj=1Wj
Note that the weights Wj depend on δ. Alternatively, we have X2(ˆδ)=0 so that we can find ˆδ that minimizes ξMN(δ). We can transform δ∈(−1,1) to tan(δπ/2)∈(−∞,∞). We start from δ1=min and \delta_2 = \max\{r_{Aj}-r_{Bj}: j = 1,\ldots, K\} and use golden section search to find the value minimizing the objective function.
After the first step, we have \hat\delta_L \in (-1, \hat\delta) and \hat\delta_U \in (\hat\delta, 1). By solving \xi^{MN}(\delta) = \chi^2_{1, 1-\alpha/2}, we can finish the second step.
CMH Weights for M&N Method
The M&N weights are W_j^{MN}(\delta) \propto \left[\frac{\widetilde{R}_{A}^{*}\left(1-\widetilde{R}_{A}^{*}\right)}{\widetilde{R}_{B}^{*}\left(1-\widetilde{R}_{B}^{*}\right)} / n_{A j}+1 / n_{B j}\right]^{-1} and CMH weights are W_j^{CMH} \propto \left[\frac{1}{n_{Aj}} + \frac{1}{n_{Bj}} \right]^{-1} Two cases that two types of weights are identical:Equivalence of M&N Tests and CMH Test When \delta = 0
The CMH test statistics is \xi_{C M H}=\frac{\left[\sum_{j=1}^{K}\left(x_{Aj}-\frac{x_{+j} n_{Aj}}{N_{j}}\right)\right]^{2}}{\sum_{j=1}^{K} \frac{x_{+j} y_{-j} n_{Aj} n_{Bj}}{N_{j}^{2}\left(N_{j}-1\right)}} \sim \chi^2_1 Note that x_{Aj}-\frac{x_{+j} n_{Aj}}{N_{j}} = \frac{n_{Aj}n_{Bj}}{N_j}(r_{Aj} - r_{Bj}) and \begin{aligned} \frac{x_{+j} y_{-j} n_{Aj} n_{Bj}}{N_{j}^{2}\left(N_{j}-1\right)} & = \left(\frac{n_{Aj}n_{Bj}}{N_j}\right)^2\frac{x_{+j}y_{-j}}{N_j^2}\frac{n_{Aj}+n_{Bj}}{n_{Aj}n_{Bj}}\frac{N_j}{N_j-1}\\ & = \left(\frac{n_{Aj}n_{Bj}}{N_j}\right)^2\left\{\bar r_j(1-\bar r_j)\left(\frac{1}{n_{Aj}}+\frac{1}{n_{Bj}}\right) \right\}\frac{N_j}{N_j-1} \end{aligned} The CMH test statistics can be modified as \begin{aligned} \xi_{C M H} & =\frac{\left[\sum_{j=1}^{K}\left(x_{Aj}-\frac{x_{+j} n_{Aj}}{N_{j}}\right)\right]^{2}}{\sum_{j=1}^{K} \frac{x_{+j} y_{-j} n_{Aj} n_{Bj}}{N_{j}^{2}\left(N_{j}-1\right)}} \\ & = \frac{\left[\sum_{j=1}^K W_j^{CMH}(r_{Aj} - r_{Bj})\right]^2}{\sum_{j=1}^K (W_j^{CMH})^2 V_{r_{Aj} - r_{Bj}}^{CMH}} \end{aligned} where W_j^{CMH} = \frac{n_{Aj}n_{Bj}}{N_j} = \left[\frac{1}{n_{Aj}} + \frac{1}{n_{Bj}}\right]^{-1} and V_{r_{Aj} - r_{Bj}}^{CMH} = \left\{\bar r_j(1-\bar r_j)\left(\frac{1}{n_{Aj}}+\frac{1}{n_{Bj}}\right) \right\}\frac{N_j}{N_j-1} When \delta = 0, from the above discussion, under the null hypothesis H(0): \pi_{Aj} = \pi_{Bj}. The constrained MLEs have \widetilde{R}_{Aj} = \widetilde{R}_{Bj}. From (), we have \widetilde{R}_A^* = \widetilde{R}_B^* so that () becomes W_j^{MN} = \left[\frac{1}{n_{Aj}} + \frac{1}{n_{Bj}}\right]^2 and V_{r_{Aj} - r_{Bj}}^{MN} = \left\{\widetilde{R}_{Aj}(1-\widetilde{R}_{Aj})\left(\frac{1}{n_{Aj}}+\frac{1}{n_{Bj}}\right) \right\}\frac{N_j}{N_j-1}
Note that \widetilde{R}_{Aj} \neq \bar r_{j} when \delta = 0. From Appendix 1, we have L0 = 0, \space L1 = x_{+j}, \space L_2 = -N_j - x_{+j}, \space L_3 = N_j so that \begin{aligned} p & = \pm \frac{\sqrt{N_j^2 + x_{+j}^2 - N_jx_{+j}}}{3N_j}\\ q & = \frac{-(N_j+x_{+j})(2N_j-x_{+j})(N_j-2x_{+j})}{54N_j^3} \end{aligned} Based on triple angle formula, \cos(3a) = 4\cos^3 a - 3\cos a = 4 \left(\frac{\widetilde{R}_{Bj} + \frac{L_2}{3L_3}}{2p}\right)^3 - 3\frac{\widetilde{R}_{Bj} + \frac{L_2}{3L_3}}{2p} Solving this equation, we have \widetilde{R}_{Bj} = \bar r_j (the other two solutions are 1 and 0).
Because W_j^{CMH} = W_j^{MN} and V_{r_{Aj} - r_{Bj}}^{CMH} = V_{r_{Aj} - r_{Bj}}^{MN}, we can say the two test statistics \xi_{CMH} = \xi_{MN} under \delta = 0.
Appendix 1
Miettinen and Nurminen provided a closed-form solution for the MLEs of \widetilde{R}_{Aj} and \widetilde{R}_{Bj} where \begin{aligned} \widetilde{R}_{Bj} &=2 p \cos (a)-L_{2} /\left(3 L_{3}\right) \\ \widetilde{R}_{Aj} & = \widetilde{R}_{Bj} + \delta\\ a &=(1 / 3)\left[\pi+\cos ^{-1}\left(q / p^{3}\right)\right] \\ p &=\pm\left[L_{2}^{2} /\left(3 L_{3}\right)^{2}-L_{1} /\left(3 L_{3}\right)\right]^{1 / 2} \\ q &=L_{2}^{3} /\left(3 L_{3}\right)^{3}-L_{1} L_{2} /\left(6 L_{3}^{2}\right)+L_{0} /\left(2 L_{3}\right) \\ L_{3} &= N_j \\ L_{2} & =\left(n_{Aj}+2 n_{Bj}\right)\delta- N_j- x_{+j}\\ L_{1} & =\left[n_{Bj}\delta-n_{Bj}-n_{Aj}-2 x_{Bj}\right]\delta+x_{+j} \\ L_{0} & =x_{Bj}\delta(1-\delta) \end{aligned}