|
Fisher's exact test 应该是这样的
Fisher's exact test for 2x2 tables and some measures of association based on chi-square.
Fisher's Exact Test
Fisher's exact test is another test of association between the row and column variables. This test assumes that the row and column totals are fixed, and then uses the hypergeometric distribution to compute probabilities of possible tables with these observed row and column totals. Fisher's exact test does not depend on any large-sample distribution assumptions, and so it is appropriate even for small sample sizes and for sparse tables.
2 × 2 Tables
For 2 ×2 tables, PROC FREQ gives the following information for Fisher's exact test: table probability, two-sided p-value, left-sided p-value, and right-sided p-value. The table probability equals the hypergeometric probability of the observed table, and is in fact the value of the test statistic for Fisher's exact test.
Where is the hypergeometric probability of a specific table with the observed row and column totals, Fisher's exact p-values are computed by summing probabilities over defined sets of tables,
The two-sided p-value is the sum of all possible table probabilties (for tables having the observed row and column totals) that are less than or equal to the observed table probability. So, for the two-sided p-value, the set includes all possible tables with hypergeometric probabilities less than or equal to the probability of the observed table. A small two-sided p-value supports the alternative hypothesis of association between the row and column variables.
One-sided tests are defined in terms of the frequency of the cell in the first row and first column of the table, the (1,1) cell. Denoting the observed (1,1) cell frequency by F, the left-sided p-value for Fisher's exact test is probability that the (1,1) cell frequency is less than or equal to F. So, for the left-sided p-value, the set includes those tables with a (1,1) cell frequency less than or equal to F. A small left-sided p-value supports the alternative hypothesis that the probability of an observation being in the first cell is less than expected under the null hypothesis of independent row and column variables.
Similarly, for a right-sided alternative hypothesis, is the set of tables where the frequency of the (1,1) cell is greater than or equal to that in the observed table. A small right-sided p-value supports the alternative that the probability of the first cell is greater than that expected under the null hypothesis.
Because the (1,1) cell frequency completely determines the 2 ×2 table when the marginal row and column sums are fixed, these one-sided alternatives can be equivalently stated in terms of other cell probabilities or ratios of cell probabilities. The left-sided alternative is equivalent to an odds ratio greater than 1, where the odds ratio equals ( ). Additionally, the left-sided alternative is equivalent to the column 1 risk for row 1 being less than the column 1 risk for row 2, . Similarly, the right-sided alternative is equivalent to the column 1 risk for row 1 being greater than the column 1 risk for row 2, . Refer to Agresti (1996).
R × C Tables
Fisher's exact test was extended to general R ×C tables by Freeman and Halton (1951), and this test is also known as the Freeman-Halton test. For R ×C tables, the two-sided p-value is defined the same as it is for 2 ×2 tables. The set contains all tables with less than or equal to the probability of the observed table. A small p-value supports the alternative hypothesis of association between the row and column variables. For R ×C tables, Fisher's exact test is inherently two-sided. The alternative hypothesis is defined only in terms of general, and not linear, association. Therefore, PROC FREQ does not provide right-sided or left-sided p-values for general R ×C tables.
For R ×C tables, PROC FREQ computes Fisher's exact test using the network algorithm of Mehta and Patel (1983), which provides a faster and more efficient solution than direct enumeration.
|