Announcement

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

  • Obtaining odds ratios after svy: gsem

    Hello Statalisters, I am trying to obtain odds ratios after svy: gsem. The command "estat eform eq1 eq2" only works with gsem, but not when svy:gsem is used.
    Any idea why it exponentiates regular gsem but not svy: gsem?
    And does anyone have suggestions on how to obtain the odds ratios in similar format as produced by regular gsem post estimation ?

    Thank you,
    YR

  • #2
    i suspect this is an oversight that could be fixed. You could improvise via something like

    Code:
    gsem (low <- age lwt i.race smoke ptl ht ui) [pw = wgtvar], logit
    estat eform
    The standard errors and CIs would be wrong but you would have the correct point estimates (I think).
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      I suggest that you send a minimum working example of the problem to Technical Support. Include information on your Stata version and OS system. To make the example self-contained, have it use one of the system or Manual datasets, otherwise attach your own data. The address of technical support is [email protected]
      Last edited by Steve Samuels; 05 Oct 2015, 18:58.
      Steve Samuels
      Statistical Consulting
      [email protected]

      Stata 14.2

      Comment


      • #4
        I think I found a way:

        Code:
        . webuse nhanes2f, clear
        
        . svy: gsem (diabetes <- age weight), logit nolog
        (running gsem on estimation sample)
        
        Survey: Generalized structural equation model
        
        Number of strata   =        31                Number of obs     =       10,335
        Number of PSUs     =        62                Population size   =  116,997,257
                                                      Design df         =           31
        Response           : diabetes
        Family             : Bernoulli
        Link               : logit
        
        ------------------------------------------------------------------------------
                     |             Linearized
                     |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        diabetes <-  |
                 age |   .0596362   .0043864    13.60   0.000     .0506901    .0685822
              weight |   .0189069   .0031305     6.04   0.000     .0125223    .0252916
               _cons |   -7.65599    .411973   -18.58   0.000    -8.496214   -6.815765
        ------------------------------------------------------------------------------
        
        . svy, eform
        
        Survey: Generalized structural equation model
        
        Number of strata   =        31                Number of obs     =       10,335
        Number of PSUs     =        62                Population size   =  116,997,257
                                                      Design df         =           31
        Response           : diabetes
        Family             : Bernoulli
        Link               : logit
        
        ------------------------------------------------------------------------------
                     |             Linearized
                     |     exp(b)   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        diabetes <-  |
                 age |    1.06145   .0046559    13.60   0.000     1.051997    1.070989
              weight |   1.019087   .0031902     6.04   0.000     1.012601    1.025614
               _cons |   .0004732   .0001949   -18.58   0.000     .0002042    .0010964
        ------------------------------------------------------------------------------
        
        . svy, or
        option or not allowed
        r(198);
        In other words I just did a replay with svy. I could have also specified svy, eform on the original command. Note that the or option didn't work, perhaps because svy doesn't know that it is legitimate in this case, but the generic eform option does.

        I think this could be more clearly documented -- I looked at both the gsem and svy documentation before coming across the eform option. And I am not sure why estat eform just doesn't work with gsem anyway.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          It occurs to me my strategy would be sub-optimal if you don't want every equation exponentiated. That is why it would be nice to have estat eform supported.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Dear Richard and Steve, thank you for the examples and comments. svy, eform worked. Saved me a lot of time extracting scalars and exponentiating. I will certainly send an email to stata tech support, perhaps they can add that to the help document so others will know.

            Regards,
            Yusuf

            Comment


            • #7
              Dear colleagues, I received a response from Stata Tech Support and they provided the following command which works after you estimate your model.

              ereturn display, eform(or)

              Comment


              • #8
                Originally posted by Yusuf Ransome View Post
                Dear colleagues, I received a response from Stata Tech Support and they provided the following command which works after you estimate your model.

                ereturn display, eform(or)
                Thanks for posting this. I was trying to figure out how to get RRRs for my output using gsem. That syntax worked.

                Comment

                Working...
                X