Announcement

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

  • Replicating sample size for prevalence from Daniel WW (1999)

    Hi all

    I am trying to replicate a simple formula of sample size for estimating a proportion from Daniel WW (1999) Biostatistics: A Foundation for Analysis in the Health Sciences.

    n= (z^2 * p*(1-p))/ d^2

    in this example for

    p=0.05
    d= 0.05
    z=1.96

    n=73

    I wonder if its posible get this result using the comand power oneproportion or similar. Lamentably I could not understand completly:

    Code:
     power oneproportion 0.05 ????, power(0.8 0.9) graph table
    Thanks in advance
    Rodrigo
    Last edited by Rodrigo Badilla; 15 Apr 2024, 21:40.

  • #2
    Your code implies that you have a reference (null) proportion of .05. Is this correct? If so, then you need to swap the question marks for one (or many) values to represent the alternative proportion(s) you hope to find. If you wanted to look at a range of proportions, you could do something like the following, which asks for the sample size to detect alternative proportions between 0.1 and 0.3 by increments of .05:
    Code:
    power oneproportion 0.05 (.1(.05).3), power(0.8 0.9) graph table
    You must use your subject matter expertise to define the proportions you hope/expect given your outcome or measure.
    Last edited by Erik Ruzek; 16 Apr 2024, 13:33. Reason: Grammatical edit

    Comment


    • #3
      Thanks Erik Ruzek for you reply. The proportion from literature its 0.05, for this prevalence I would like get the sample size using the command: power oneproportion, if its possible.

      When I run your comman I expected get the n for this proportion, but in the table I can not get the number expected according the formula in #1

      Code:
      
      . power oneproportion 0.05 (.1(.05).3), power(0.8 0.9) graph table
      
      Performing iteration ...
      
      Estimated sample size for a one-sample proportion test
      Score z test
      H0: p = p0  versus  Ha: p != p0
      
        +-------------------------------------------------+
        |   alpha   power       N   delta      p0      pa |
        |-------------------------------------------------|
        |     .05      .8     185     .05     .05      .1 |
        |     .05      .9     264     .05     .05      .1 |
        |     .05      .8      53      .1     .05     .15 |
        |     .05      .9      79      .1     .05     .15 |
        |     .05      .8      26     .15     .05      .2 |
        |     .05      .9      40     .15     .05      .2 |
        |     .05      .8      16      .2     .05     .25 |
        |     .05      .9      25      .2     .05     .25 |
        |     .05      .8      11     .25     .05      .3 |
        |     .05      .9      17     .25     .05      .3 |
        +-------------------------------------------------+

      Comment


      • #4
        Finally I can find some reference and explication for how work with command power oneproportion. I was wrong in some principles or theory about it.

        I could replicate results from Tutorial in biostatistics: sample sizes for parallel group clinical trials with binary data (Julious and Campbell, 2012)
        Click image for larger version

Name:	Sin título.png
Views:	1
Size:	93.3 KB
ID:	1750313







        Code:
        
         power oneproportion  (.05 (.05) .3) .35, power(.9)
        
        Performing iteration ...
        
        Estimated sample size for a one-sample proportion test
        Score z test
        H0: p = p0  versus  Ha: p != p0
        
          +-------------------------------------------------+
          |   alpha   power       N   delta      p0      pa |
          |-------------------------------------------------|
          |     .05      .9      12      .3     .05     .35 |
          |     .05      .9      24     .25      .1     .35 |
          |     .05      .9      43      .2     .15     .35 |
          |     .05      .9      87     .15      .2     .35 |
          |     .05      .9     214      .1     .25     .35 |
          |     .05      .9     912     .05      .3     .35 |
          +-------------------------------------------------+
        Last edited by Rodrigo Badilla; 17 Apr 2024, 08:39.

        Comment

        Working...
        X