Announcement

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

  • How to change default CI

    Hi community,

    I am working on some survey data and need to use the Wilson CI. I am not sure how to specify this within Stata to change from the default Clopper–Pearson.

    Any guidance on this would be greatly appreciated!

    -T

  • #2
    Can you clarify the command your are using?

    Comment


    • #3
      So when doing proportions in stata using survey data this is what we’d do:

      svy: prop (var1), over (var2)
      estat cv

      Comment


      • #4
        Type

        Code:
        help proportion
        Then check the option

        Code:
        citype(citype)

        Comment


        • #5
          Thanks very much for the suggestion. I do run into some issues using citype(citype)


          Set weights

          code:

          svyset [pweight=WeightN], brrweight(Wgt_1- Wgt_500) vce(brr) dof(500)

          Proportions

          code:

          svy: prop var1, over (var2), citype (wilson)

          Error: invalid 'citype'

          however if I used the following code below it works. The only thing is if you want to look at 3 variables at a time or something you’d have to do a subpop each time rather than using “over” which makes this easier to look at all at once.

          svy, subpop (if var2==1): prop var1, citype (wilson)
          svy, subpop (if var2==2): prop var1, citype (wilson)

          Any suggestions to help make this code work with the over option?




          Last edited by Tia Landry; 15 Jul 2023, 13:58.

          Comment


          • #6
            the problem with the code in #5 that did not work is the extra comma before "citype"; options follow odd numbered commas but you have put a second comma and that is wrong

            Comment


            • #7
              You have two commas in the command that isn't working. Try this:

              Code:
              svy: prop var1, over(var2) citype(wilson)
              --
              Bruce Weaver
              Email: [email protected]
              Version: Stata/MP 19.5 (Windows)

              Comment


              • #8
                Thanks so much I don’t know how I missed that. Appreciate all the help. Thanks again everyone!

                Comment


                • #9
                  Would you happen to know how you can specify a wilson ci within an espost svy command, citype(citype) does not work here.

                  Code:
                  estpost svy: tabulate var_1 var_2 if var_1==1 |var_1==0,col percent format(%11.3g) ci
                  Last edited by Tia Landry; 19 Jul 2023, 17:14.

                  Comment


                  • #10
                    I have tried ci(wislon) with no luck when its included with estpost

                    Comment

                    Working...
                    X