Announcement

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

  • Using power/sampsi command in stata 13

    Dear Statalisters,


    I am trying to solve the following problem using power analysis in Stata and was hoping to get some advice.

    “You are considering undertaking a pilot study of health in a population of interest, and you need to determine sample size. One indicator is systolic blood pressure (BP). Using mean and standard deviation measurements from “x.dta”, determine how large a sample you would need to be able to detect a 10 point differential between two groups (equal size) in your study, with group A having systolic BP at the level of the “x.dta” sample and Group B having BP 10 points higher. (Assume the SD of both distributions matches the x.dta overall value), at a statistical power of 0.8. Mean of BP of x.dta is 130.8817, sd is 23.33625”

    In response to the above question, I wrote down 2 Stata commands.

    sampsi 0 10, sd1(23.33265) sd2(23.33265) power(.8) onesided
    power twomeans 130.8817, sd(23.33265) diff(10) power(0.8) onesided

    I was wondering whether anyone could tell me:

    1. Whether the above commands are correct
    2. Whether it makes sense to use “onesided” or “twosided”
    3. Why do the two commands give different values for sample size? Which one should I be using?

    Thank you.

    Monzur

  • #2
    Manzur:
    although your query looks suspiciously similar to a statistical assignment (and this kind of questions are out of the scope of ths forum), you laudably gave it a try before posting instead of addressing it simply to the list. hence, I think you problem is worth receiveing an answer:
    - I think your codes are correct. However, please note that if you're using Stata 13.1 (otherwise, as per FAQ, you should declare it) -sampsi- is an out-of-date command, replaced by -pss-
    However, I have quite the same results with both the commands (two-sided):

    power twomeans 130.8817 130.9817, sd(23.3363)

    Performing iteration ...

    Estimated sample sizes for a two-sample means test
    t test assuming sd1 = sd2 = sd
    Ho: m2 = m1 versus Ha: m2 != m1

    Study parameters:

    alpha = 0.0500
    power = 0.8000
    delta = 0.1000
    m1 = 130.8817
    m2 = 130.9817
    sd = 23.3363

    Estimated sample sizes:

    N = 1709746
    N per group = 854873
    ----------------------------------------

    sampsi 130.8817 130.9817, sd1(23.33625) sd2(23.33625) power(.80)

    Estimated sample size for two-sample comparison of means

    Test Ho: m1 = m2, where m1 is the mean in population 1
    and m2 is the mean in population 2
    Assumptions:

    alpha = 0.0500 (two-sided)
    power = 0.8000
    m1 = 130.882
    m2 = 130.982
    sd1 = 23.3363
    sd2 = 23.3363
    n2/n1 = 1.00

    Estimated required sample sizes:

    n1 = 854870
    n2 = 854870
    I suppose that the slight difference in sample size is due to the iterative approach of -pss- (that I would use).

    - I would go two-sided, unless you are confident that one-side inference is peculiar to your problems. If I recall it correctly, an interesting case of one-side hypothesis testing, as afar as the systolic BP is concerned, is the following one. When the mean systolic BP of air traffic controllers (ATCs) is tested against the mean reference value of the general population, a one-side t-test is usually performed, because, due to the previous reserches, ATCs have, on average, a higher mean systolic BP than general population.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Well, maybe we shouldn't tell you. But Carlo works with a difference of 0.10 points; in the question the assumption is 10 points, giving quite a different sample size.

      Comment


      • #4
        Svend:
        thanks for pointing out my unfortunate misreading.
        Revised codes and results are reported below:

        Code:
        power twomeans 130.8817 140.8817, sd(23.3363)
        
        Performing iteration ...
        
        Estimated sample sizes for a two-sample means test
        t test assuming sd1 = sd2 = sd
        Ho: m2 = m1  versus  Ha: m2 != m1
        
        Study parameters:
        
                alpha =    0.0500
                power =    0.8000
                delta =   10.0000
                   m1 =  130.8817
                   m2 =  140.8817
                   sd =   23.3363
        
        Estimated sample sizes:
        
                    N =       174
          N per group =        87
        
        sampsi 130.8817 140.8817, sd1(23.33625) sd2(23.33625) power(.80)
        
        Estimated sample size for two-sample comparison of means
        
        Test Ho: m1 = m2, where m1 is the mean in population 1
                            and m2 is the mean in population 2
        Assumptions:
        
                 alpha =   0.0500  (two-sided)
                 power =   0.8000
                    m1 =  130.882
                    m2 =  140.882
                   sd1 =  23.3363
                   sd2 =  23.3363
                 n2/n1 =     1.00
        
        Estimated required sample sizes:
        
                    n1 =       86
                    n2 =       86
        Other previous comments still holds.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Carlo:

          Thank you very much for your help regarding the Stata commands, and for making me aware of the Stata forum rules!

          Thanks, Svend for pointing out the differences in the numbers used.


          Regards,

          Monzur

          Comment

          Working...
          X