Announcement

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

  • Tab command has no confidence interval option

    Hi there

    It seems like this should be very easy to accomplish in Stata and yet I have long struggled with it.

    I simply want my table output to have the following columns:

    denominator, numerator, row %, CI-lower, CI-upper

    e.g. something like this:
    500, 100, 20.0, 16.7, 23.7
    600, 50, 8.3, 6.4, 10.8

    I'm amazed confidence intervals aren't built into the tab command options, so I wonder if there is an alternative?

    With thanks


  • #2
    The tabulate commands produce descriptive statistics. Confidence intervals and the like are not purely descriptive - there are assumptions underlying them - and they are supported by estimation commands. The estimation command you likely want is the proportion command, which supports the following confidence intervals for you to choose from.
    Code:
        citype                      Description
        ---------------------------------------------------------------------------------------
        logit                       calculate logit-transformed confidence intervals; the
                                      default
        agresti                     calculate Agresti-Coull confidence intervals
        exact                       calculate exact (Clopper-Pearson) confidence intervals
        jeffreys                    calculate Jeffreys confidence intervals
        normal                      calculate normal (Wald) confidence intervals
        wald                        synonym for normal
        wilson                      calculate Wilson confidence intervals
        ---------------------------------------------------------------------------------------

    Comment


    • #3
      Thanks William. I don't think -proportion- outputs the denominator and numerator.

      Comment


      • #4
        One way could be to collapse my data to get the aggregated numerators and denominators, calculate the % into a new variable, then calculate the lower and upper CIs into new variables. But this seems very long winded!

        It's really a question of presentation, which I appreciate can take so many variations so it's perhaps not surprising there's not a command that can do it straightforwardly.

        That said, I imagine in most scientific publications n/N, % (CI) is a very commonly needed format, and I'd find it disappointing if there's not a command that can put these elements together.
        Last edited by tim bradshaw; 22 May 2020, 14:16.

        Comment


        • #5
          Furthermore, the options chi2 and gamma are (arguably) underpinned by some comparatively more sophisticated calculations than CIs.

          Comment


          • #6
            What you are looking for is the confidence interval for proportions. This is a surprisingly complicated problem, for wich multiple different sollutions exist, each with their own strengths and weaknesses. This is why this is delegated to its own command, proportion, and rightly so. In fact, the chi2 and gamma you mentioned are much less sophisticated then what is needed for the confidence intervals.
            ---------------------------------
            Maarten L. Buis
            University of Konstanz
            Department of history and sociology
            box 40
            78457 Konstanz
            Germany
            http://www.maartenbuis.nl
            ---------------------------------

            Comment


            • #7
              Understandable - it's just a shame then that -proportions- doesn't appear to output the numerator and denominator, since this is basic information upon which the proportion is based.

              Comment

              Working...
              X