Let me use Les Kalish s example: Outcome group et ter Best yi|a_1-=1|a_2=2 3=3 y1=0|193167 n11 n13 22|n23 n n+3 PROC FREQ When I used SAS in grad school to analyze these data, we used PROC FREQ DATA=. TABLES GROUP*OUTCOME/ CHISQ CMH SCORES=TABLE The test statistic was shown on the output as Value Prob Mantel-Haenszel Chi-square 4.515 0.034 The test statistic is not a Mantel-Haenszel-at least not according to what I learned a Mantel-Haenszel statistic is(from Gary Koch at UNC--note that any errors here, I should add, are those of this student, not of this great researcher/teacher
Let me use Les Kalish’s example: Outcome ---------------------------- group | Good | Better | Best y_i | a_1=1| a_2=2 | a_3=3 ------+--------+--------+--------- | | | y_1=0| 19 | 31 | 67 | n_11 | n_12 | n_13 | | | y_2=1| 1 | 5 | 21 | n_21 | n_22 | n_23 | | | ------+--------+--------+--------- 20 36 88 n_+1 n_+2 n_+3 PROC FREQ When I used SAS in grad school to analyze these data, we used PR0C FREQ DATA=... TABLES GROUP*OUTCOME / CHISQ CMH SCORES=TABLE The test statistic was shown on the output as DF Value Prob --- ----- ----- Mantel-Haenszel Chi-Square 1 4.515 0.034 The test statistic is not a Mantel–Haenszel—at least not according to what I learned a Mantel–Haenszel statistic is (from Gary Koch at UNC—note that any errors here, I should add, are those of this student, not of this great researcher/teacher)
Dr. Koch called this chi-squared statistic Qs, where s stands for score. Chi-squared statistic for trend Qs Let me express Qs in terms of a simpler statistic, T T=(sum over group i)(sum over outcome j) ni *k aj *k yi The aj are scores; here 1, 2, 3, but there can be other choices for the scores(Ill get to this later) Under the null hypothesis there is no association between group and outcome, so we can consider the permutation(i.e, randomization) distribution of T That is, we fix the margins of the table, just as we do for Fisher's exact test, and then consider all the possible permutations that give these same marginal counts. Under this null hypothesis permutation distribution, it is easy to see that the mean of T is E(T)=N*a bar *k y bar where a bar is the weighted average of aj(using the marginal counts n ij) a bar =(sum over j)n+ *k a/N Similarly, y bar is a weighted average of yi. The variance of T, under the permutation distribution, is(exactly) V(T)=(N-1)*S2*Sy2 where Sa is the stand ard deviation squared for aj Sa =(1/(N-1))*(sum over j)n+*(a,-a bar) We can compute a chi-squared statistic Qs =(T-E(T))/ V(T) f you look at the formula for Qs, you see something interesting. It is simply Qs=(N-1)*r2
Dr. Koch called this chi-squared statistic Qs, where s stands for score. Chi-squared statistic for trend Qs Let me express Qs in terms of a simpler statistic, T: T = (sum over group i)(sum over outcome j) nij * aj * yi The aj are scores; here 1, 2, 3, but there can be other choices for the scores (I’ll get to this later). Under the null hypothesis there is no association between group and outcome, so we can consider the permutation (i.e., randomization) distribution of T. That is, we fix the margins of the table, just as we do for Fisher’s exact test, and then consider all the possible permutatio ns that give these same marginal counts. Under this null hypothesis permutation distribution, it is easy to see that the mean of T is E(T) = N * a_bar * y_bar where a_bar is the weighted average of aj (using the marginal counts n +j): a_bar = (sum over j) n+j * aj / N Similarly, y_bar is a weighted average of yi. The variance of T, under the permutation distribution, is (exactly) V(T) = (N - 1) * Sa 2 * Sy 2 where Sa 2 is the standard deviation squared for aj: Sa 2 = (1/(N-1)) * (sum over j) n+j * (aj - a_bar)2 We can compute a chi-squared statistic: Qs = (T - E(T))2 / V(T) If you look at the formula for Qs, you see something interesting. It is simply Qs = (N - 1) * ray 2