Announcement

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

  • Calculating ratio with confidence interval

    Dear All,

    Do you perhaps have any advice on how to calculate the ratio with 95% confidence interval from the table that is produced from svy, over(exposure): proportion outcome? What kind of command I could use on this?

    Here is the result that I got from this command:

    Code:
    . svy, over(birth_place): proportion v401 if bidx==1 & b5==1 
    (running proportion on estimation sample)
    
    Survey: Proportion estimation
    
    Number of strata =      67               Number of obs   =     15,028
    Number of PSUs   =   1,967               Population size = 14,740.883
                                             Design df       =      1,900
    
    ---------------------------------------------------------------------
                        |             Linearized            Logit
                        | Proportion   Std. Err.     [95% Conf. Interval]
    --------------------+------------------------------------------------
       v401@birth_place |
      no public sector  |   .7844617   .0079373      .7684879    .7996208
     no private sector  |   .7804379   .0073014      .7657834    .7944217
              no other  |          1          .             .           .
     yes public sector  |   .2155383   .0079373      .2003792    .2315121
    yes private sector  |   .2195621   .0073014      .2055783    .2342166
             yes other  |          0  (no observations)
    ---------------------------------------------------------------------
    I would like to calculate the ratio of yes public sector and yes private sector. I have run the following commands to calculate the non linear combination (tried different combinations inspired from website to make it work but failed):

    nlcom yes public sector/yes private sector
    nlcom [v401@birth_place]yes public sector/[v401@birth_place]yes private sector
    nlcom _b[yes public sector]/_b[yes private sector]
    nlcom [birth_place]yes public sector/[birth_place]yes private sector
    nlcom _b[birth_place:0]/_b[birth_place:1]
    Is there something wrong with the commands or did I miss a crucial step prior calculating the nlcom? Appreciate your help on this. Thank you.

  • #2
    Have you tried svy: ratio?

    Also, you may want to change your syntax to
    Code:
    svy, over(birth_place) subpop(if bidx==1 & b5==1): proportion v401
    (The code above is untested.) For an explanation of why subpop() is usually preferable to if with svy estimation, see https://stats.idre.ucla.edu/stata/fa...data-in-stata/ or help svy.
    David Radwin
    Senior Researcher, California Competes
    californiacompetes.org
    Pronouns: He/Him

    Comment


    • #3
      Dear David,

      Thank you so much for your help! I have found the issue on this - I tried my codes on my friend's Stata 15.l and the codes run very well - yet this does not work on my Stata 16 package. I posted a question on this also here: https://www.statalist.org/forums/for...-16-any-advice. If you know what this issue would be, I would really appreciate if you can give me suggestion. Thank you once again David!

      Best,
      Rana

      Comment

      Working...
      X