Announcement

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

  • How to determine confidence intervals around percentages

    Hi all,
    I would appreciate it if you could help with my question.

    I used the following command to get percentages for my main independent variable (sex):
    tabulate sex variable2, col chi2 --> got a 2x2 table (each variable has 2 levels)

    Now, i need to get confidence intervals around the percentages in each cell (four cells). I used the following command but doesn't work:
    ci proportions sex variable2

    And this command (ci proportions sex) gives me confidence intervals for sex not for men and women separately
    Thank you very much,
    Nila

  • #2
    Please provide the exact command you gave in Stata and the exact output (use code delimiters--explained in FAQ #12).

    When I run the command you give, I get the following error:
    Code:
    . ci proportions sex variable2
    variable proportions not found
    So this is obviously not what you typed.

    The command:
    Code:
    proportion sex, over(variable2)
    will give you confidence intervals for the same proportions of cases given in the command:
    Code:
    tab sex variable2, col
    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment


    • #3
      Thank you, thank you very much; I really appreciate it. I spent the whole day to figure it out but you saved me.
      I used the command "proportion sex, over (variable2)" and as you mentioned, it gave me CIs for the proportions I needed.
      Thank you very much, Nila

      Comment


      • #4
        Note that there are different approaches with different results for calculating confidence intervals of proportions. You will find examples and links to the literature in http://www.statalist.org/forums/foru...eneral/1328961

        Comment


        • #5
          Note further that ci proportions is legal syntax as of Stata 14.1

          http://www.stata.com/help.cgi?whatsnew


          -------- update 29oct2015 (Stata version 14.1)

          2. ci and cii have the following improvements and changes:

          a. With new commands ci variances and cii variances, you can now compute confidence intervals for variances or standard deviations. Classical confidence intervals for normal data and Bonett confidence intervals for nonnormal data are provided.

          b. ci means and cii means are now used to compute confidence intervals for means of normally and Poisson distributed variates. The previous commands were ci and cii. The old syntax is preserved under version control.

          c. ci proportions and cii proportions are now used to compute confidence intervals for proportions. The previous commands were ci with option binomial and cii with option binomial. The old syntax is preserved under version control.

          Comment


          • #6
            Thank you very much Dirk; I really appreciate the link to your detailed explanations.
            Nila

            Comment


            • #7
              Thank you very much Nick; I was wondering how come the code didn't work with my stata; thank you.
              Nila

              Comment

              Working...
              X