mantelhaenzel(A)
Computes the Mantel-Haenszel Odds Ratio Estimate test using data in array A and a significance level of 0.95 (95%). Array A must be an array of contingency tables 2x2.
mantelhaenszel(A, alpha)
As above but the significance level is alpha.
See also breslowday chi2_mantel
Example
The following data was collected:
|
|||
|
|||
Entering the first data in a matrix we obtain:
a1=(7,16;22,44)
/ 7 16 \
\ 22 44 /
Using function chi2_totable to transform matrix a1 into a proper contingency table we get:
a1=chi2_totable(a1)
/ "" "" "" "" \
| "" 7 16 23 |
| "" 22 44 66 |
\ "" 29 60 89 /
The second table is:
a2=(63, 36; 7, 4)
/ 63 36 \
\ 7 4 /
Using function chi2_totable again we get:
a2=chi2_totable(a2)
/ "" "" "" "" \
| "" 63 36 99 |
| "" 7 4 11 |
\ "" 70 40 110 /
We now put the two 2x2 contingency tables into an array:
A=(a1, a2)
/ / "" "" "" "" \ / "" "" "" "" \ \
| | "" 7 16 23 | | "" 63 36 99 | |
| | "" 22 44 66 | | "" 7 4 11 | |
\ \ "" 29 60 89 / \ "" 70 40 110 / /
Using function mantelhaenszel we get:
mantelhaenszel(A)
Mantel-Haenszel Odds Ratio Estimate.
Significance level : 0.95 (95.0%)
Results:
OR: 0.9208477791587625
ln(OR) : -0.08246053417306863
Std.Error of ln(OR) : 0.4100965292305143
Asymp.Sig (2-sided): 0.8406392149103488
Confidence interval for OR
Lower bound : 0.4122048180260054
Upper bound : 2.0571342092564486
Confidence interval for ln(OR)
Lower bound : -0.8862349220302721
Upper bound : 0.7213138536841347