Hello Giuseppe,
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.
e.g.
>> x1 = [17, 7; 1707 1786];
>> odds(x1)
Significance level: 95%
Risk Ratio: 1.1188<1.4494<1.8779
Absolute risk reduction: 22.0%
Relative risk reduction: 31.0%
Odds Ratio: 1.0511<2.5410<6.1425
Phi: 0.0327
Weak positive association (risk factor)
...
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,
let a=17,b=1690,c=7,d=1779
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:
en.wikipedia.org/wiki/Odds_ratio#Example
p1/(1-p1)
---------
p2/(1-p2)
Using the same data as before:
17/1690 0.0100591
------- = --------- = 2.5565
7/1779 0.0039347
Again this is quite different to your ODDS function output for the Odds ratio which has 2.5410.
Are you able to please explain these discrepancies?
Regards,
Bruce