Announcement

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

  • Bugs on Stata 16 - any advice?

    Dear All,

    I am trying to calculate ratio with nlcom after the svy, over(exposure): proportion outcome. It works really well on Stata 15.1 as attached below:


    Click image for larger version

Name:	Screen Shot 2019-12-13 at 12.09.42 PM.png
Views:	2
Size:	117.6 KB
ID:	1528490
    Click image for larger version

Name:	Screen Shot 2019-12-13 at 12.09.54 PM.png
Views:	2
Size:	43.5 KB
ID:	1528491

    However, this does not work at all on Stata 16 - and how the Stata 16 generated the table also is different with Stata 15.1 (without list of parameters above the table), attached here:

    Click image for larger version

Name:	Screen Shot 2019-12-13 at 12.40.39.png
Views:	2
Size:	68.5 KB
ID:	1528492

    Does anyone have any experience on this? Any solution on how to calculate nlcom after svy, over(exposure): proportion outcome on Stata 16?

    Appreciate your help. Thank you.


    Best,
    Rana


    Attached Files
    Last edited by Rana Zahroh; 12 Dec 2019, 19:03.

  • #2
    Hi All,

    I realized now that this is not a bug, just Stata 16 generates the table differently from Stata 15. I tried to generate the nlcom with the command below, as suggested by the manual:

    Code:
    . svy, subpop(if bidx==1 & b5==1): proportion v401, over(birth_place)
    (running proportion on estimation sample)
    
    Survey: Proportion estimation
    
    Number of strata =      67            Number of obs   =     17,836
    Number of PSUs   =   1,967            Population size = 17,010.939
                                          Subpop. no. obs =     15,028
                                          Subpop. size    = 14,740.883
                                          Design df       =      1,900
    
    ------------------------------------------------------------------
                     |             Linearized            Logit
                     | Proportion   Std. Err.     [95% Conf. Interval]
    -----------------+------------------------------------------------
    v401@birth_place |
             no pub  |   .7844617   .0079373      .7684879    .7996208
             no pri  |   .7804379   .0073014      .7657834    .7944217
           no other  |          1          .             .           .
            yes pub  |   .2155383   .0079373      .2003792    .2315121
            yes pri  |   .2195621   .0073014      .2055783    .2342166
          yes other  |          0  (no observations)
    ------------------------------------------------------------------
    And then:

    Code:
    nlcom v401#0.birth_place/v401#1.birth_place
    But still does not work, anyone has any advice on this?

    Thank you.

    Comment


    • #3
      I don’t really know. But if all worked well in Stata 15.1, try preceding your other commands with

      version 15.1
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

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

      Comment


      • #4
        Thank you! Unfortunately I do not have the 15.1 package as it is my supervisor's not mine. But I have found a way to calculate the nlcom on Stata 16:

        nlcom _b[1.v401#0.birth_place]/_b[1.v401#1.birth_place]
        Might be useful for other people encountering the same problem.

        Also just got a call from technical staff in Survey Design Australia that if we have a command from older version that does not work in newer version, we can just copy paste the commands from the do-file from older version to the do-file in the newer version.

        Cheers,
        Rana

        Comment


        • #5
          You don’t need Stata 15,1. Read the help on the version command. It can keep your commands running correctly as you upgrade to newer versions of Stata.
          -------------------------------------------
          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
            Oh my God, I did not know this. I just tried it and it worked really well! Thank you so much for letting me know this, it is (and will be) really helpful for the future!

            version 15.1: svy, subpop(if bidx==1 & b5==1): proportion v401, over(birth_place)
            nlcom [yes]pub/[yes]pri
            Thank you!

            Best,
            Rana

            Comment


            • #7
              The option -coefleg- shows how specify the coefficients in expressions:

              Code:
              --------------------------------------------------------------------------
              
              . webuse nhanes2f
              
              . svy , over(rural): proportion smsa, coefleg
              (running proportion on estimation sample)
              
              Survey: Proportion estimation
              
              Number of strata =      31      Number of obs   =       10,337
              Number of PSUs   =      62      Population size =  117,023,659
                                              Design df       =           31
              
              ------------------------------------------------------------------------------
                           | Proportion  Legend
              -------------+----------------------------------------------------------------
                smsa@rural |
                      1 0  |   .3844816  _b[[email protected]]
                      1 1  |   .0016318  _b[[email protected]]
                      2 0  |   .4193348  _b[[email protected]]
                      2 1  |   .2238066  _b[[email protected]]
                      4 0  |   .1961836  _b[[email protected]]
                      4 1  |   .7745616  _b[[email protected]]
              ------------------------------------------------------------------------------

              Comment


              • #8
                Thank you so much! I was figuring out the commands by myself and did not know there is an easy way to find out the expressions! This is really helpful!

                Best,
                Rana

                Comment

                Working...
                X