Announcement

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

  • Obtaining 95% CIs for relative risk from -teffects ipwra-

    Based on information contained within this thread, I am now trying to obtain adjusted relative risks using the potential outcome means obtained from the -teffects ipwra- package.

    The following output is obtained from one of the Stata examples.

    Commands:
    Code:
    teffects ipwra (lbweight mmarried c.mage##c.mage fbaby medu, logit) ///
                 (mbsmoke mmarried c.mage##c.mage fbaby medu, logit), pomeans
                 
    teffects ipwra (lbweight mmarried c.mage##c.mage fbaby medu, logit) ///
                 (mbsmoke mmarried c.mage##c.mage fbaby medu, logit), ate


    Output Obtained:
    Code:
    Treatment-effects estimation                    Number of obs     =      4,642
    Estimator      : inverse-probability weights
    Outcome model  : weighted mean
    Treatment model: logit
    -------------------------------------------------------------------------------
                  |               Robust
         lbweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    --------------+----------------------------------------------------------------
    POmeans       |
          mbsmoke |
       nonsmoker  |   .0514829   .0037385    13.77   0.000     .0441556    .0588102
          smoker  |   .1030977   .0120102     8.58   0.000      .079558    .1266373
    -------------------------------------------------------------------------------
    
    
    
    Treatment-effects estimation                    Number of obs     =      4,642
    Estimator      : inverse-probability weights
    Outcome model  : weighted mean
    Treatment model: logit
    ----------------------------------------------------------------------------------------
                           |               Robust
                  lbweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -----------------------+----------------------------------------------------------------
    ATE                    |
                   mbsmoke |
    (smoker vs nonsmoker)  |   .0516147   .0125786     4.10   0.000     .0269611    .0762683
    -----------------------+----------------------------------------------------------------
    POmean                 |
                   mbsmoke |
                nonsmoker  |   .0514829   .0037385    13.77   0.000     .0441556    .0588102
    ----------------------------------------------------------------------------------------

    My Problem:
    The first two bolded numbers (0.0514829 and 0.1030977) I interpret as the probabilities of the binary outcome "low birthweight" (lbweight) after adjustment for the covariates included in the IPW and RA portions of the overall command. The third bolded number (0.0516147) is the absolute risk difference between the two groups (smoking and non-smoking).

    Assuming the above interpretation is correct, then the relative risk is = .1030977 / .0514829 = 2.003, correct?

    So, how can I obtain the 95% CI for this RR? Do I perform the same calculation on each side of the POmeans' 95% CIs so that:

    upper limit of 95% CI = .1266373 / .0588102 = 2.153
    lower limit of 95% CI = .079558 / .0441556 = 1.8018

    ?

    If the above is true, is there any automated way to get this output from the -teffects- package?

    Many thanks for any help with this.

    Phil

  • #2
    I guess I should also add that my alternative is to analyze these data using logistic regression, but the IPWRA technique was appealing to me due to the doubly-robust nature of it. The only catch with using IPWRA is that it does not output odds ratios, and odds ratios are commonly used in my area (medicine) even though RRrs are much more intuitive to my target audience. So, understanding if I have the above interpretation correct is fundamental. If anyone has any experience interpreting the above type of results in the way I'm intending to, I'd appreciate the support (or, if I've got it wrong, I would appreciate the correction!). Happy New Year to everyone!

    Comment


    • #3
      Jonathan Bartlett

      I believe I have found the answer to my question, thanks to Jonathan Bartlett (his blog is here: http://thestatsgeek.com/2015/03/09/e...a/#comment-569).

      In contrast to my first post above, I believe the correct way of doing this is as below.

      Code:
      cls
      webuse cattaneo2, clear
                   
      teffects ipwra (lbweight mmarried c.mage##c.mage fbaby medu, logit) ///
                   (mbsmoke mmarried c.mage##c.mage fbaby medu, logit), pomeans
      
      teffects, coeflegend
      
      nlcom log(_b[POmeans:1.mbsmoke] / _b[POmeans:0bn.mbsmoke])
      
      di exp(.706206) // 2.03
      di exp(.4211756) // 1.52
      di exp( .9912363) // 2.69

      which gives the following output:

      Code:
      Treatment-effects estimation                    Number of obs     =      4,642
      Estimator      : IPW regression adjustment
      Outcome model  : logit
      Treatment model: logit
      -------------------------------------------------------------------------------
                    |               Robust
           lbweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      --------------+----------------------------------------------------------------
      POmeans       |
            mbsmoke |
         nonsmoker  |   .0512242   .0037079    13.81   0.000     .0439568    .0584915
            smoker  |   .1037949   .0130897     7.93   0.000     .0781397    .1294502
      -------------------------------------------------------------------------------
      
      . 
      . teffects, coeflegend
      
      Treatment-effects estimation                    Number of obs     =      4,642
      Estimator      : IPW regression adjustment
      Outcome model  : logit
      Treatment model: logit
      -------------------------------------------------------------------------------
           lbweight |      Coef.  Legend
      --------------+----------------------------------------------------------------
      POmeans       |
            mbsmoke |
         nonsmoker  |   .0512242  _b[POmeans:0bn.mbsmoke]
            smoker  |   .1037949  _b[POmeans:1.mbsmoke]
      -------------------------------------------------------------------------------
      
      . 
      . nlcom log(_b[POmeans:1.mbsmoke] / _b[POmeans:0bn.mbsmoke])
      
             _nl_1:  log(_b[POmeans:1.mbsmoke] / _b[POmeans:0bn.mbsmoke])
      
      ------------------------------------------------------------------------------
          lbweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
             _nl_1 |    .706206   .1454263     4.86   0.000     .4211756    .9912363
      ------------------------------------------------------------------------------
      
      . 
      . di exp(.706206) // risk ratio
      2.0262889
      
      . di exp(.4211756) // lwr end of 95% CI
      1.5237518
      
      . di exp( .9912363) // upr end of 95% CI
      2.6945637

      Comment


      • #4
        Philip's well-developed answer to his own question has been very helpful to a problem I'm working on, that has two parts.
        - estimating the Risk Ratio after -TEFFECTS- (applying Philip's method to my data was straightforward) , and
        - estimating the Risk Difference after -TEFFECTS- (where I'm not sure how to implement the -nlcom-- step for a Risk Difference).

        I'd appreciate any guidance as to how to proceed would be helpful.

        Comment


        • #5
          Michael,.

          For the above example, to get the RD, it is even easier since the ln-transform is not required.

          Code:
          nlcom _b[POmeans:1.mbsmoke] - _b[POmeans:0bn.mbsmoke]
          Let me know if any problems!

          Comment


          • #6
            Got it, yes I see, and therefore exponentiation not required to get RD & CIs.
            Many thanks, Philip!

            Comment


            • #7
              Given the number of researchers, at least in the biomedical fields, who need this information, it would be nice if StataCorp would consider making this output a little more automated than it currently is. Something like:

              Code:
              teffects ipw (vars) (vars), pomeans rr rd

              Comment


              • #8
                Thank-you very much Philip: I think your hint is very useful since not necessarily researchers want to report risk difference (RD) as a measure of effect. I think that, since the RR is already computable directly as you did in your first post of the topic (as the ratio of the proportions we get with the "pomeans" option), a simple check of the correctness of the procedure is easily available. I'm using that check to propose a modification of your code to estimate the odds ratio (OR), since I don't think the "rd" option would be needed (RD is already calculated by the default "ate" option). Thus, I'd modify your proposal into this:
                Code:
                teffects ipw (vars) (vars), pomeans rr or
                I believe the only modification needed to the code you indicated for the RR to get the OR is to replace
                Code:
                  
                 nlcom log(_b[POmeans:1.mbsmoke] / _b[POmeans:0bn.mbsmoke])
                with
                Code:
                nlcom log((_b[POmeans:1.mbsmoke] / _b[POmeans:0bn.mbsmoke])/((1-_b[POmeans:1bn.mbsmoke])/(1-_b[POmeans:0.mbsmoke])))
                It seems to me it works:

                Code:
                nlcom log((_b[POmeans:1.mbsmoke] / _b[POmeans:0bn.mbsmoke])/((1-_b[POmeans:1bn.mbsmoke])/(1-_b[POmeans:0.mbsmoke])))
                
                       _nl_1:  log((_b[POmeans:1.mbsmoke] / _b[POmeans:0bn.mbsmoke])/((1-_b[POmeans:1bn.mbsmoke])/(1-_b[POmeans:0.mbsmoke])))
                
                ------------------------------------------------------------------------------
                    lbweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                       _nl_1 |   .7632093   .1600874     4.77   0.000     .4494438    1.076975
                ------------------------------------------------------------------------------
                
                
                
                . di exp(.7632093)
                2.1451496
                
                
                
                . di (.1037949/.0512242)/((1-.1037949)/(1-.0512242))
                2.1451468
                Please anyone let me know if you find mistakes in this.

                Federico
                Last edited by Federico Tedeschi; 31 Jul 2019, 03:19.

                Comment


                • #9
                  On second thought: I think the above would be valid for the estimation of the marginal OR. In case we assumed individual counterfactual probabilities differ from person to person and we wanted to estimate them by including covariates in the outcome model, then we could be interested in the conditional OR and, in that case, the estimated coefficients (and CIs) from the outcome regression would be needed. I think, however, that, in case we want to evaluate the effect of the treatment, marginal ORs could be informative since we are likely to be interested to a population-level effect.

                  Comment

                  Working...
                  X