This function calculates the Risk Ratio and the Odds Ratio (OR) on a 2x2 input matrix. Both ratios are computed with confidence intervals. If confidence interval of OR doesn't encompass the value OR=1, then the function computes the Bayesian Credibility Assessment of the test. If the test is credible, the function calculates the Association Parameter Phi. The association parameter Phi=sqrt(chisquare/N). The routine coumputes the Power and, if necessary, the sample sizes needed to achieve a power=0.80 using a modified asymptotic normal method with continuity correction as described by Hardeo Sahai and Anwer Khurshid in Statistics in Medicine, 1996, Vol. 15, Issue 1: 1-21.
Look well the matrix you gave to odds!
you wrote x1 = [17, 7; 1707 1786];
so a=17, b=7, c=1707 and d=1786.
If you use the correct matrix of your example
>> x=[17 1690;7 1779];
Significance level: 95%
I ran your ODDS function for a microbiologist's data set and we both feel after a little research that ODDS is producing an Odds Ratio rather than a Risk Ratio. Our definitions of Risk ratio and Odds ratio are backed up by WIKI as well and I include the links as well.
You can see that 2.5410 is the Odds ratio according to the data but in fact this should be the Risk Ratio not the value
1.4494 as printed above from ODDS.
We base these assertions on some simple arithmetic backed up by WIKI defs: en.wikipedia.org/wiki/Relative_risk
i.e. Risk Ratio (RR) is defined as:
RR = [a/(a+b)]/[c/(c+d)]
So given this, using our data,
so RR = (17/1779)/(7/1786) = 0.00996/0.00392 = 2.5410
This is what you have for Odds Ratio but but your Risk Ratio shows 1.4494, a quite different result to 2.5410
Also the Odds Ratio is defined here: