Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi David,

    I have a quick question regarding ipdmetan.
    I am running a meta-analysis with individual-patient data and am using ipdmetan and ipdover. Overall, the packages are great. Easy-to-use and work great.
    I have one study that has a zero cell in subgroup analysis. I am trying to add a continuity correction but am having trouble finding how to do this with ipdmetan. I looked at the help file ("help ipdmetan") and on several links on ipdmetan (Stata Journal, 2015, Volume 15, Number 2) with little luck on this.

    Is this application possible with ipdmetan?

    Thanks for any help you can provide!

    Leo



    Comment


    • #17
      Hi Leo,

      I assume you're using logistic regression with a binary outcome and a binary treatment effect?

      Unfortunately ipdmetan and ipdover do not currently support continuity corrections, but I'm hoping to include this in a later version.

      Here are some suggestions for what you might do:


      1) Simply accept that the treatment effect within the subgroup in question is not estimable (and a zero cell suggests that the effect may not be very useful anyway). The keepall option in ipdmetan and ipdover will give you a forest plot where the subgroup is listed on the left-hand side, but on the right it says "(Insufficient data)".


      2) For analyses without meta-analysis pooling (e.g. those using ipdover), use the saving() option (along with keepall), open the saved dataset, and replace the missing effect size for the troublesome subgroup with an estimate from another source. For example, you could collapse the data to a 2x2 table to use with metan in Stata (which does support continuity correction) or to calculate it manually using e.g. Excel. Alternatively, there are "exact" logistic regression commands such as exlogistic in Stata which can handle zero cells but don't always run successfully. Either way, once you have modified your saved dataset, run the forestplot command.

      NOTE: if using this approach, you will unfortunately encounter a bug in forestplot whereby it will show all the boxes the same size, rather than weighted by sample size. To correct this, simply run the following command before running forestplot:
      Code:
      gen _WT = _NN

      3) Perform a continuity correction "manually" by temporarily adding an extra four observations (rows) corresponding to each cell of a 2x2 table, and using iweights with logistic to give these observations half the weight of the others. This is fiddly to set up, and I only mention it here for completeness really. But depending on your setup you may find it useful.


      I hope that helps; let me know if you have any questions.

      Thanks,

      David.

      Comment


      • #18
        Thanks so much David for your detailed response and giving me so many alternative options! I'm going to try 2 and 3 but may end up just going for #1.

        Have a great day!

        Best,
        Leo

        Comment


        • #19
          Hi David,

          Thanks for writing this wonderful program.

          However, How do I get relative risk? In your example data, when I specify rr, its says option "rrr not allowed" "Error in ipdmetan"

          The code I used for the ipdover is as below:

          Code:
          webuse lbw, clear
          recode age (min/24=0 "<25") (25/max=1 "25+"), gen(agegp) label(agegp)
          label var agegp "Mother's age (grouped)"
          gen low1 = low
          gen low0 = 1 - low
          gen smoke0 = smoke * low0
          gen smoke1 = smoke * low1
          ipdover, over(race ht agegp) lcols((sum) smoke0 low0 smoke1 low1) nowt rr saving(test1.dta,replace) : binreg low smoke
          This is the error that came up:
          Code:
          option rrr not allowed
          Error in ipdmetan
          r(198);
          Please how do I get around this as I need RR rather than OR.

          Thanks

          Comment


          • #20
            Dear Madu,
            Thanks for your message.

            This is an interesting example, as it demonstrates the difference between options specified to [command] (here, binreg) and options specified to ipdover.
            Unfortunately, it has also highlighted two bugs in the ipdover code!

            Firstly, let's briefly put the bugs aside and discuss the actual code. Generally speaking, there is no reason why you shouldn't specify "rr" in the way that you show. However, this option is only passed to ipdover. Here, you also need to specify "rr" to binreg, since this option fundamentally changes the way binreg behaves (i.e. the choice of link function). Hence, your command should be:
            Code:
            ipdover, over(race ht agegp) lcols((sum) smoke0 low0 smoke1 low1) nowt rr saving(test1.dta,replace) : binreg low smoke, rr
            Of course, this doesn't (currently) help you, due to the bugs that I mentioned!!

            There is a way around this, but unfortunately it involves several lines of code. Basically, you can use ipdmetan (which only suffers from one of the two bugs) on each over() variable in turn; append the datasets; convert the result to ipdover format (i.e. what would have been saved in test1.dta had ipdover worked properly); and finally use forestplot to create the plot:
            Code:
            ipdmetan, study(race) lcols((sum) smoke0 low0 smoke1 low1) nowt saving(test1_race.dta, replace stacklabel) nogr noov : binreg low smoke, rr
            ipdmetan, study(ht) lcols((sum) smoke0 low0 smoke1 low1) nowt saving(test1_ht.dta, replace stacklabel) nogr noov : binreg low smoke, rr
            ipdmetan, study(agegp) lcols((sum) smoke0 low0 smoke1 low1) nowt saving(test1_agegp.dta, replace stacklabel) nogr nohet : binreg low smoke, rr
            
            use test1_race, clear
            append using test1_ht test1_agegp, gen(_OVER)
            label values _STUDY
            rename _STUDY _LEVELS
            replace _OVER=. if _USE==5
            
            local oldN = _N
            expand 2 if _USE==0
            replace _USE=6 if _n > `oldN'
            replace _LABELS="" if _n > `oldN'
            sort _OVER _USE _LEVELS
            
            forestplot, lcols(smoke0 low0 smoke1 low1) nowt rr saving(test1.dta,replace)

            My apologies for all this inconvenience. The bugs will be fixed in the next update; they are only small. In the meantime, let me know if I can help you further.

            Thanks,

            David.

            Comment


            • #21
              Hi David,

              Thank you for your response and providing a way to work around this. With this process, the overall effect that is calculated is based on (age) where you did not specify -noov-. This gives a wrong overall effect.

              I will demonstrate this with the logit for odds ratio


              Code:
              webuse lbw, clear
              recode age (min/24=0 "<25") (25/max=1 "25+"), gen(agegp) label(agegp)
              label var agegp "Mother's age (grouped)"
              gen low1 = low
              gen low0 = 1 - low
              gen smoke0 = smoke * low0
              gen smoke1 = smoke * low1
              ipdover, over(race ht agegp) lcols((sum) smoke0 low0 smoke1 low1) nowt or saving(test1.dta,replace) : logit low smoke
              This is the result with accurate overall effect of 2.022

              Code:
               ipdmetan, study(race) lcols((sum) smoke0 low0 smoke1 low1) nowt saving(test1_race.dta, replace stacklabel) nogr noov : binreg low smoke, or
              ipdmetan, study(ht) lcols((sum) smoke0 low0 smoke1 low1) nowt saving(test1_ht.dta, replace stacklabel) nogr noov : binreg low smoke, or
              ipdmetan, study(agegp) lcols((sum) smoke0 low0 smoke1 low1) nowt saving(test1_agegp.dta, replace stacklabel) nogr nohet : binreg low smoke, or
              Now if I run your suggested code using the ipdmetan as above, the overall effect is 0.700

              Can you advice how to get the correct overall effect using your suggested code?

              Thanks



              Comment

              Working...
              X