strengejacke / esc

Effect Size Computation for Meta Analysis
https://strengejacke.github.io/esc
19 stars 5 forks source link

esc_2x2 giving different results than Wilson's #9

Open djmeter opened 2 years ago

djmeter commented 2 years ago

I ran the following code and got a different result than with the web-based 'Practical Meta-Analysis Effect Size Calculator' from David B. Wilson (http://www.campbellcollaboration.org/escalc/html/EffectSizeCalculator-Home.php)

esc_2x2( grp1yes = 205, grp1no = 98,
grp2yes = 512, grp2no = 178,
es.type = c("r") )

Could you please let me know why the formula is different? Thank you! Diana

strengejacke commented 2 years ago

Where do you see discrepancies?

esc::esc_2x2(
  grp1yes = 205,
  grp1no = 98,
  grp2yes = 512,
  grp2no = 178,
  es.type = "or"
)
#> 
#> Effect Size Calculation for Meta Analysis
#> 
#>      Conversion: 2x2 table (OR) coefficient to effect size odds ratio
#>     Effect Size:   0.7272
#>  Standard Error:   0.1505
#>        Variance:   0.0227
#>        Lower CI:   0.5415
#>        Upper CI:   0.9768
#>          Weight:  44.1438

Created on 2022-02-24 by the reprex package (v2.0.1)

image

strengejacke commented 2 years ago

And for logits:

esc::esc_2x2(
  grp1yes = 205,
  grp1no = 98,
  grp2yes = 512,
  grp2no = 178
)
#> 
#> Effect Size Calculation for Meta Analysis
#> 
#>      Conversion: 2x2 table (OR) to effect size logits
#>     Effect Size:  -0.3185
#>  Standard Error:   0.1505
#>        Variance:   0.0227
#>        Lower CI:  -0.6135
#>        Upper CI:  -0.0235
#>          Weight:  44.1438

Created on 2022-02-24 by the reprex package (v2.0.1)

djmeter commented 2 years ago

The discrepancy was in the r calculation, not OR. Thanks!

strengejacke commented 2 years ago

The calculator returns RR, not r.

djmeter commented 2 years ago

Ok, the esc package documentation says differently, but it is helpful to know that. Thank you. Diana

strengejacke commented 2 years ago

Ok, the esc package documentation says differently

Not sure what you mean here? The function returns the effect size that is given in the es.type argument, which is by default logits. The web-based 'Practical Meta-Analysis Effect Size Calculator' returns OR, which you can also return from esc_2x2(), and the results are the same.

xm0557 commented 2 years ago

I also encountered this problem. esc_2x2(23,29,10,3, es.type="r")gave r = -0.3019; but the website showed different results.

截屏2022-06-21 10 09 44
xm0557 commented 2 years ago

Furthermore, esc_2x2(23,29,10,3, es.type="r")give different result from esc_2x2(23,10,29,3, es.type="r").