Announcement

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

  • Sample Size Determination

    I'm working on an assignment and am VERY new to stata and just wondering if I'm headed in the right direction.

    I am given a problem with two groups and told to use sampsi to find the estimated required sample sizes. I am given a SD change, minimum sample size and alpha error and beta error.

    I'm just wondering if I'm headed in the right direction as I am given the answer to what the sample size should be but simply have to show the correct command to how I got my answer. So far, I have done the following:

    Code:
    sampsi 0 .2, p(0.8) alpha(0.05)
    * .2= sd change
    *p(.8) = account in betta error of .2
    *alpha(.05) = alpha error

    But the n1 and n2 are very off. I am given the required sample size and an allowance for % loss of follow up. I'm wondering if I need to add a pre and post option and possibly r0 r1 r01.
    Last edited by pete serra; 14 Jun 2023, 10:35.

  • #2
    -sampsi- is now outdated and has been replaced by -power-. You don't tell us enough information to be sure. What is the design? I assume it's a continuous outcome. Here is an example of the use of -power twomeans-. -power- (and presumably, -sampsi-) require an estimate of the group standard deviations, which you have not supplied to the command. Right now it's estimating a standard effect size of 0.2 (assuming a common SD=1), which is small effect size and so would require a larger sample size.

    You may read further about -power- by -help power- and reading the PDF document linked at the top of the page.

    Code:
    . power twomeans 0 0.2, sd(1) power(0.80) alpha(0.05)
    
    Performing iteration ...
    
    Estimated sample sizes for a two-sample means test
    t test assuming sd1 = sd2 = sd
    H0: m2 = m1  versus  Ha: m2 != m1
    
    Study parameters:
    
            alpha =    0.0500
            power =    0.8000
            delta =    0.2000
               m1 =    0.0000
               m2 =    0.2000
               sd =    1.0000
    
    Estimated sample sizes:
    
                N =       788
      N per group =       394

    Comment


    • #3
      Dang, I tried the power twomeans about 2 hours ago and got this correct answer but assumed that sampsi is what I had to do. I read further down and saw power twomeans was acceptable. Thank you for your help. I

      I did try the same command without the alpha and got the right answer but I assume it is because it's a default value. Either way, thank you.

      Comment


      • #4
        is population risk difference can be calculated from two proportions during the sample size in stata? In other software in case of two proportion there is population risk difference. do anyone have code on this

        Comment

        Working...
        X