+ Reply to Thread
Results 1 to 3 of 3

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

  1. #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
    Last edited by Sarah-Jo Sinnott; 07-09-2012 at 07:25 AM.

  2. #2
    ggplot2orBust
    Points: 25,031, Level: 95
    Level completed: 69%, Points required for next Level: 319
    trinker's Avatar
    Location
    Buffalo, NY
    Posts
    3,220
    Thanks
    920
    Thanked 563 Times in 510 Posts

    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?
    "If you torture the data long enough it will eventually confess."
    -Ronald Harry Coase -

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

    Sarah-Jo Sinnott (07-09-2012)

  4. #3
    Points: 656, Level: 13
    Level completed: 12%, Points required for next Level: 44

    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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

+ Reply to Thread

Posting Permissions

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








Advertise on Talk Stats