Announcement

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

  • confidence intervals for a proportion

    Hello...
    I have a very simple question... how can I get confidence intervals for a proportion obtained by a 'tab' command: eg. " tab x y, col "
    Wish it was as simple as "tab x y, col ci " but to no avail.

    I have a large population based study (n=3000; 200 variables) of child development scores and I just want to show initial proportions between variables with confidence intervals.



    Thanks

    Chand

  • #2
    Hello Gok,

    Welcome to the Stata Forum.

    You may wish to type:

    Code:
    cii n_sample n_cases
    Best,

    Marcos
    Best regards,

    Marcos

    Comment


    • #3
      Gok:
      assuming you want binomial exact CI, you may want to try something along the line of the following example:
      Code:
      . cii proportions 100 60, exact
      
                                                               -- Binomial Exact --
          Variable |        Obs  Proportion    Std. Err.       [95% Conf. Interval]
      -------------+---------------------------------------------------------------
                   |        100          .6    .0489898        .4972092    .6967052
      Conversely, if the variables you're interested in are already reported in your dataset, the following approach probably fits your needs:
      Code:
      . sysuse bplong.dta
      (fictional blood-pressure data)
      
      
      . ci proportions sex, exact
      
                                                               -- Binomial Exact --
          Variable |        Obs  Proportion    Std. Err.       [95% Conf. Interval]
      -------------+---------------------------------------------------------------
               sex |        240          .5    .0322749         .435002     .564998
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Thank you vey much for the correction, Carlo. Only now I notice I forgot to type "proportions" in the Stata command. Best, Marcos.
        Best regards,

        Marcos

        Comment

        Working...
        X