Announcement

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

  • How to calculate overall confidence intervals from geometric means?

    Hello,
    I have two geometric means (both of which are average antibody concentrations for a group of subjects calculated by multiplying all values and taking the nth root of this number, where n is the number of subjects with available data).

    Group 1: Mean = 8985, confidence intervals = 5705–14150
    67 people

    Group 2: Mean = 7622, confidence intervals = 5486–10591
    132 people

    Overall mean: 8056.

    Please could someone advise how I calculate the overall 95% confidence intervals?
    Many thanks

  • #2
    Welcome to Statalist.

    The output of the Stata command help geometric points us to the ameans command.
    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . ameans price
    
        Variable |    Type             Obs        Mean       [95% Conf. Interval]
    -------------+---------------------------------------------------------------
           price | Arithmetic           74    6165.257        5481.914     6848.6
                 |  Geometric           74    5656.907        5165.664   6194.865
                 |   Harmonic           74    5296.672        4928.901    5723.75
    -----------------------------------------------------------------------------
    
    . by foreign, sort: ameans price
    
    ------------------------------------------------------------------------------------------------
    -> foreign = Domestic
    
        Variable |    Type             Obs        Mean       [95% Conf. Interval]
    -------------+---------------------------------------------------------------
           price | Arithmetic           52    6072.423        5210.184   6934.662 
                 |  Geometric           52    5533.564        4945.587   6191.446 
                 |   Harmonic           52    5171.918         4749.29   5677.111 
    -----------------------------------------------------------------------------
    
    ------------------------------------------------------------------------------------------------
    -> foreign = Foreign
    
        Variable |    Type             Obs        Mean       [95% Conf. Interval]
    -------------+---------------------------------------------------------------
           price | Arithmetic           22    6384.682         5222.19   7547.174 
                 |  Geometric           22    5959.483        5063.614   7013.853 
                 |   Harmonic           22    5616.916        4904.397   6571.657 
    -----------------------------------------------------------------------------

    Comment


    • #3
      -help means-. N.B. -means-, not -mean-.

      Comment


      • #4
        Note the common thread in posts #2 and #3: Google is not the only search engine available; Stata's built-in help and search commands do a good job of finding results that are relevant to Stata users without having to sort through answers for SPSS or SAS or R users.

        Comment


        • #5
          Hi thank you. Is this possible to do with the information I have provided?
          I don’t have every individual score of the 67 participants in group one, or the individual scores of the 132 participants in group 2. I just have their mean scores from which I have calculated the overall mean. But I do not know the formula for calculating overall CIs.

          i haven’t inputted my data into Stata I just inputted the above numbers as

          Code:
          di
          to calculate the overall mean.

          Comment


          • #6
            Is this possible to do with the information I have provided?
            The mean and variance of a set of numbers xi can be expressed in terms of the sum of the xi and the sum of the xi2. The usual way of calculating geometric means and their confidence intervals is to calculate zi = ln(xi), then calculate the arithmetic mean and confidence interval for the zi, and then exponentiate each of these to get the geometric mean and confidence intervals.

            So from what you show, it should be possible to
            • start with the within group geometric means and confidence intervals for the xi
            • take logs to get the within group arithmetic means and confidence intervals for the zi = log(xi)
            • derive from these arithmetic means and confidence intervals the within group sums of the zi and the zi2
            • add the sums from the two groups to get the overall sums of the zi and the zi2
            • use these sums to calculate the arithmetic means and confidence intervals of the zi and the zi2
            • exponentiate the results to give the overall geometric mean and confidence interval for the xi.

            Comment


            • #7
              Okay I got this to calculate the mean:

              Code:
              di  67*log(8985) + 132*log(7622)
              777.318812122
              
              di 777.318812122/199
              3.90612468403
              
              di exp(3.90612468403)
              8056.09666003
              Can you advise do I calculate the overall confidence intervals in exactly the same way?

              i.e
              Code:
              67*log(5705)+132*log(5486)..... etc etc
              (With group 1 confidence intervals = 5705–14150
              67 people

              Group 2: confidence intervals = 5486–10591
              132 people)
              Last edited by Sal Watts; 15 Dec 2019, 13:12.

              Comment


              • #8
                Can you advise do I calculate the overall confidence intervals in exactly the same way?
                No, that's not what the results of the technique in post #6 are. In that post, I gave an abstract of the steps someone with a reasonable basic knowledge of mathematical statistics would go through to calculate the confidence intervals. I didn't know your background and didn't want to assume you wouldn't perhaps be saying "oh, yes, of course." But it appears what I wrote may be beyond your background in statistics.

                I'm not a statistician so I generally spend my time on Statalist answering Stata programming questions. Your question is more about statistical methodology – the only connection to Stata is using the display command as a pocket calculator – so perhaps one of the more methodological members can help further with the math to give you the formulas you need.

                Comment

                Working...
                X