Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oddsratio: accept raw odds #102

Closed
tbates opened this issue Aug 19, 2019 · 3 comments
Closed

oddsratio: accept raw odds #102

tbates opened this issue Aug 19, 2019 · 3 comments
Assignees

Comments

@tbates
Copy link
Owner

tbates commented Aug 19, 2019

currently user says:

oddsratio(grp1=c(n=11, N=15), grp2 = c(n=2, N=15))

let's allow:

oddsratio(grp1=11/4, grp2 = 2/13)
@tbates tbates self-assigned this Aug 19, 2019
@mcneale
Copy link
Collaborator

mcneale commented Aug 19, 2019

Odds ratios are bad measures of association. When base rates differ, the same odds ratio can represent very different degrees of association/correlation. I suggest that this warning be added to all odds ratio output.

@tbates
Copy link
Owner Author

tbates commented Aug 19, 2019

Yeah… oddsratio is just a convenience function for me to decode stats reported in medical papers where they turn small effects into large odds ratios :-)

Added deg2rad and rad2deg also: how can R not have those, when its trig funs are in radians... oh well.

Tangentially, we're writing up a replication of a study that had n= 30 divided between 2 groups. In group1, just 4 of 15 subjects responded, in group2: 11 of 15...

Post-hoc power analysis χ² suggests n = 10 gives 99% power to replicate… We ran with n= 30 and got… p = 0.6 Science train badly off the rails :-(

Oh well, learned how to compute a χ² effect size.

Imagine if R was around in the 80s when Cohen and power hit the headlines… might have rippled much faster with open-source...

library(pwr)
ES.w1(c(11/15,  4/15), c( 2/15, 13/15))

effect size = 1.36 !! in education...

@tbates
Copy link
Owner Author

tbates commented Aug 19, 2019

oddsratio(grp1 = c(n= 1, N= 10), grp2 = c(n = 3, N = 10))
Group 1 odds = 0.111
Group 2 odds = 0.429
          OR = 0.259 CI95 [0.023, 2.936]

note: When base rates differ, a given odds ratio can represent very different degrees of association/correlation

oddsratio(grp1 = 1/9, grp2 = 3/9)
Group 1 odds = 0.111
Group 2 odds = 0.333
          OR = 0.333 (input odds as c(n=, N=) to compute CI)
note: When base rates differ, a given odds ratio can represent very different degrees of association/correlation

@tbates tbates closed this as completed in 893cf16 Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants