|
ODDS RATIO INDEPENDENCE TESTName:
= (N11N22)/ (N12N21) where
N21 = number of failures in sample 1 N12 = number of successes in sample 2 N22 = number of failures in sample 2 The first definition shows the meaning of the odds ratio clearly, although it is more commonly given in the literature with the second definition. The log odds ratio is the logarithm of the odds ratio:
= LOG{(N11N22)/ (N12N21)} Alternatively, the log odds ratio can be given in terms of the proportions
= LOG{(p11p22)/ (p12p21)} where
= proportion of successes in sample 1 p21 = N21/ (N11 + N21) = proportion of failures in sample 1 p12 = N12/ (N12 + N22) = proportion of successes in sample 2 p22 = N22/ (N12 + N22) = proportion of failures in sample 2 Success and failure can denote any binary response. Dataplot expects "success" to be coded as "1" and "failure" to be coded as "0". The bias corrected version of the statistic is:
In addition to reducing bias, this statistic also has the advantage that the odds ratio is still defined even when N12 or N21 is zero (the uncorrected statistic will be undefined for these cases). Note that N11, N21, N12, and N22 defines a 2x2 contingency table. These types of contingency tables are also referred to as fourfold tables. A common question with regards to a two-way contingency table is whether we have independence. By independence, we mean that the row and column variables are unassociated (i.e., knowing the value of the row variable will not help us predict the value of column variable and likewise knowing the value of the column variable will not help us predict the value of the row variable). A more technical definition for independence is that
One such test for the special case described above (i.e., we have success/failure data) is the log odds ratio test for independence.
<SUBSET/EXCEPT/FOR qualification> where <y1> is the first response variable; <y2> is the second response variable; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax is used for the case where you have raw data (i.e., the data has not yet been cross tabulated into a two-way table).
<SUBSET/EXCEPT/FOR qualification> where <m> is a matrix containing the two-way table; and where the <SUBSET/EXCEPT/FOR qualification> is optional. This syntax is used for the case where we the data have already been cross-tabulated into a two-way contingency table.
where <n11> is a parameter containing the value for row 1, column 1 of a 2x2 table; <n12> is a parameter containing the value for row 1, column 2 of a 2x2 table; <n21> is a parameter containing the value for row 2, column 1 of a 2x2 table; <n22> is a parameter containing the value for row 2, column 2 of a 2x2 table. This syntax is used for the special case where you have a 2x2 table. In this case, you can enter the 4 values directly, although you do need to be careful that the parameters are entered in the order expected above.
ODDS RATIO INDEPENDENCE TEST M ODDS RATIO INDEPENDENCE TEST N11 N12 N21 N22
To read this information into Dataplot, enter
READ DPST1F.DAT SIGLEV UNCLOWCL UNCUPPCL CORLOWCL CORUPPCL The following internal parameters are automatically saved after running this command:
The chi-square independence test is more general in the sense that it applies to RxC contingency tables, not just 2x2 tables.
Fleiss, Levin, and Paik (2003), "Statistical Methods for Rates and Proportions", Third Edition, pp. 234-238.
let n11 = 53
let n21 = 7
let n12 = 48
let n22 = 12
.
odds ratio independence test n11 n21 n12 n22
The following output is generated.
LOG(ODDS RATIO) TEST FOR INDEPENDENCE (2X2 TABLE)
NULL HYPOTHESIS: THE TWO VARIABLES ARE INDEPENDENT (LOG (ODDS RATIO) = 0)
ALTERNATIVE HYPOTHESIS: THE TWO VARIABLES ARE NOT INDEPENDENT
SAMPLE 1:
NUMBER OF OBSERVATIONS = 60
NUMBER OF SUCCESSES = 53
NUMBER OF FAILURES = 7
PROBABILITY OF SUCCESS = 0.8833333
PROBABILITY OF FAILURE = 0.1166667
SAMPLE 2:
NUMBER OF OBSERVATIONS = 60
NUMBER OF SUCCESSES = 48
NUMBER OF FAILURES = 12
PROBABILITY OF SUCCESS = 0.8000000
PROBABILITY OF FAILURE = 0.2000000
LOG(ODDS RATIO) = LOG(n11*n22/(n12*n21)):
LOG(ODDS RATIO) = 0.6380874
STANDARD ERROR OF LOG(ODDS RATIO) = 0.5156469
LOG(ODDS RATIO) (BIAS CORRECTED) = 0.6089435
STANDARD ERROR (BIAS CORRECTED) = 0.5026365
LARGE SAMPLE CONFIDENCE INTERVAL FOR LOG(ODDS RATIO)
UNCORRECTED RATIO BIAS CORRECTED RATIO
( 0.6380874 ) ( 0.6089435 )
CONFIDENCE LOWER UPPER LOWER UPPER
VALUE (%) LIMIT LIMIT LIMIT LIMIT
-----------------------------------------------------------------------
50.000 0.638087 0.638087 0.608943 0.608943
80.000 0.204108 1.07207 0.185914 1.03197
90.000 -.227407E-01 1.29892 -.352110E-01 1.25310
95.000 -.210076 1.48625 -.217820 1.43571
97.500 -.372562 1.64874 -.376206 1.59409
99.000 -.561487 1.83766 -.560364 1.77825
TEST FOR INDEPENDENCE:
CHI-SQUARE TEST STATISTIC = 1.563314
CDF OF TEST STATISTIC = 0.9410107
TEST STATISTIC (WITH YATES CORRECTION) = 1.000521
CDF OF TEST STATISTIC (YATES CORRECTION) = 0.8414708
WITHOUT YATES BIAS CORRECTION:
NULL HYPOTHESIS NULL
NULL CONFIDENCE CRITICAL ACCEPTANCE HYPOTHESIS
HYPOTHESIS LEVEL VALUE INTERVAL CONCLUSION
===================================================================
INDEPENDENT 50.0% 0.00 (0,0.500) REJECT
INDEPENDENT 80.0% 0.84 (0,0.800) REJECT
INDEPENDENT 90.0% 1.28 (0,0.900) REJECT
INDEPENDENT 95.0% 1.64 (0,0.950) ACCEPT
INDEPENDENT 97.5% 1.96 (0,0.975) ACCEPT
INDEPENDENT 99.0% 2.33 (0,0.990) ACCEPT
WITH YATES BIAS CORRECTION:
NULL HYPOTHESIS NULL
NULL CONFIDENCE CRITICAL ACCEPTANCE HYPOTHESIS
HYPOTHESIS LEVEL VALUE INTERVAL CONCLUSION
===================================================================
INDEPENDENT 50.0% 0.00 (0,0.500) REJECT
INDEPENDENT 80.0% 0.84 (0,0.800) REJECT
INDEPENDENT 90.0% 1.28 (0,0.900) ACCEPT
INDEPENDENT 95.0% 1.64 (0,0.950) ACCEPT
INDEPENDENT 97.5% 1.96 (0,0.975) ACCEPT
INDEPENDENT 99.0% 2.33 (0,0.990) ACCEPT
Program 2:
let n = 1
let p = 0.9
let y1 = binomial rand numb for i = 1 1 200
let p = 0.68
let y2 = binomial rand numb for i = 1 1 130
.
odds ratio independence test y1 y2
The following output is generated.
THE SUM OF THE 200 OBSERVATIONS = 0.1750000E+03
THE SUM OF THE 130 OBSERVATIONS = 0.8800000E+02
LOG(ODDS RATIO) TEST FOR INDEPENDENCE (2X2 TABLE)
NULL HYPOTHESIS: THE TWO VARIABLES ARE INDEPENDENT (LOG (ODDS RATIO) = 0)
ALTERNATIVE HYPOTHESIS: THE TWO VARIABLES ARE NOT INDEPENDENT
SAMPLE 1:
NUMBER OF OBSERVATIONS = 200
NUMBER OF SUCCESSES = 175
NUMBER OF FAILURES = 25
PROBABILITY OF SUCCESS = 0.8750000
PROBABILITY OF FAILURE = 0.1250000
SAMPLE 2:
NUMBER OF OBSERVATIONS = 130
NUMBER OF SUCCESSES = 88
NUMBER OF FAILURES = 42
PROBABILITY OF SUCCESS = 0.6769231
PROBABILITY OF FAILURE = 0.3230769
LOG(ODDS RATIO) = LOG(n11*n22/(n12*n21)):
LOG(ODDS RATIO) = 1.206243
STANDARD ERROR OF LOG(ODDS RATIO) = 0.2844072
LOG(ODDS RATIO) (BIAS CORRECTED) = 1.195462
STANDARD ERROR (BIAS CORRECTED) = 0.2823872
LARGE SAMPLE CONFIDENCE INTERVAL FOR LOG(ODDS RATIO)
UNCORRECTED RATIO BIAS CORRECTED RATIO
( 1.206243 ) ( 1.195462 )
CONFIDENCE LOWER UPPER LOWER UPPER
VALUE (%) LIMIT LIMIT LIMIT LIMIT
-----------------------------------------------------------------------
50.000 1.20624 1.20624 1.19546 1.19546
80.000 0.966880 1.44561 0.957799 1.43313
90.000 0.841761 1.57073 0.833568 1.55736
95.000 0.738435 1.67405 0.730976 1.65995
97.500 0.648815 1.76367 0.641993 1.74893
99.000 0.544613 1.86787 0.538531 1.85239
TEST FOR INDEPENDENCE:
CHI-SQUARE TEST STATISTIC = 19.10401
CDF OF TEST STATISTIC = 1.000000
TEST STATISTIC (WITH YATES CORRECTION) = 17.89948
CDF OF TEST STATISTIC (YATES CORRECTION) = 1.000000
WITHOUT YATES BIAS CORRECTION:
NULL HYPOTHESIS NULL
NULL CONFIDENCE CRITICAL ACCEPTANCE HYPOTHESIS
HYPOTHESIS LEVEL VALUE INTERVAL CONCLUSION
===================================================================
INDEPENDENT 50.0% 0.00 (0,0.500) REJECT
INDEPENDENT 80.0% 0.84 (0,0.800) REJECT
INDEPENDENT 90.0% 1.28 (0,0.900) REJECT
INDEPENDENT 95.0% 1.64 (0,0.950) REJECT
INDEPENDENT 97.5% 1.96 (0,0.975) REJECT
INDEPENDENT 99.0% 2.33 (0,0.990) REJECT
WITH YATES BIAS CORRECTION:
NULL HYPOTHESIS NULL
NULL CONFIDENCE CRITICAL ACCEPTANCE HYPOTHESIS
HYPOTHESIS LEVEL VALUE INTERVAL CONCLUSION
===================================================================
INDEPENDENT 50.0% 0.00 (0,0.500) REJECT
INDEPENDENT 80.0% 0.84 (0,0.800) REJECT
INDEPENDENT 90.0% 1.28 (0,0.900) REJECT
INDEPENDENT 95.0% 1.64 (0,0.950) REJECT
INDEPENDENT 97.5% 1.96 (0,0.975) REJECT
INDEPENDENT 99.0% 2.33 (0,0.990) REJECT
Date created: 1/7/2008 |