# Thread: Converting logistic OR to RR using R, based on Wang

1. ## Converting logistic OR to RR using R, based on Wang

Hi all,

I am doing a meta-analysis and am trying to convert adjusted Odds Ratios from regression analysis (presented in included papers) to Risk Ratios with corresponding Confidence intervals. I do not have raw data to work with.

I have tried two methods so far.

1) Using the one recommended by Wang using the orsk package. (http://cran.r-project.org/web/packag.../orsk_demo.pdf )
2) Researching the oddsrisk module writen by Hilbe for Stata. (http://fmwww.bc.edu/repec/bocode/o/oddsrisk.ado)

The orsk package has worked well for most of the OR to RR conversions. Its main benefit is that it needs very little info for it to work; just need the number in the control and treatment group and then the OR along with its confidence interval.
However, when I try it wil large numbers in the control and treatment groups, it will not work and I receive output such as

"Error in matrix(0, x - 1, y - 1) : too many elements specified"

I then tried the stata oddsrisk module, however, as far as I can see, I need some raw data for this to work, which I don't have access to.

Now that I have outlined the background and nature of my problem this leads me to my question......
Does anyone have any experience of converting adjusted odds ratios to risk ratios in R while using large numbers in the control and treatment group? If so, how did you get it to work?

Or, alternatively, has anybody been able to do this in Stata without raw data?

Thank you in advance for any suggestions,

Sarah-Jo

2. ## Re: Converting logistic OR to RR using R, based on Wang

In looking at first paper you give it seems you could make your own function to calculate the relative risks as the math seems pretty straight forward (though I'm no expert).

Secondly I looked at the manual for orsk and it says nothing about problems with large groups. Let's start there. Could you provide a minimal reproducible example the recreates your error?

3. ## The Following User Says Thank You to trinker For This Useful Post:

Sarah-Jo Sinnott (07-09-2012)

4. ## Re: Converting logistic OR to RR using R, based on Wang

Hi Trinker,

Thank you for replying and making suggestions. When I saw your second suggestion I went back into R and started playing around with it.

One of the errors that popped up was "Threshold value d=1e-04 is too small". I didn't understand this and showed it to the departmental statistician. On his suggestion, I changed the d value, by inserting the following code:

es1 <- orsk(nctr = 5316, ntrt = 5390, a = 1.47, al = 1.38, au = 1.57, method = "grid", d=1e-03)

This worked!

Thank you again for your help, I appreciate it.

Regards,

Sarah-Jo

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts