FAQ/rpropspow - CBU statistics Wiki

Revision 8 as of 2012-05-03 14:36:11

Clear message
location: FAQ / rpropspow

Obtaining sample sizes for a given power comparing two independent proportions in R and G*POWER3

(Taken from Jeremy Miles's e-mail to psych-postgrads)

In R it's much easier and more intuitive (than using the purpose built freeware G*POWER). The command is:

power.prop.test(p1=0.2, p2=0.3, power=0.8)

And it says:

  • Two-sample comparison of proportions power calculation
    • n = 293.1513
    • p1 = 0.2 p2 = 0.3
    • sig.level = 0.05
      • power = 0.8
  • alternative = two.sided
  • NOTE: n is number in *each* group
    • Two-sample comparison of proportions power calculation
      • n = 293.1513
      • p1 = 0.2 p2 = 0.3
      • sig.level = 0.05
        • power = 0.8
    • alternative = two.sided
    NOTE: n is number in *each* group

Comparison doing the same calculation to that above in G*POWER 3

The above calculation can also be performed using the chi-square option in G*POWER3 (or similarly and more straightforwardly (using the proportions as inputs as with R above) choosing exact tests. Contingency tables are, however, fiddly to power in GPower using the chi-square option. You have to put in the proportions in each of the cells for the alterative and null hypotheses.

If you think your intervention will result in 30% of the participants with capacity compared to a control condition of 20% with capacity, we have the following table assuming equal sized control and intervention groups:

Capacity

No Capacity

Control

0.20

0.80

Intervention

0.30

0.70

Capacity

No Capacity

Control

0.10

0.40

Psychotic Group

0.15

0.35

since the probabilities sum to one.

0.4, 0.1, 0.35, 0.15 goes into

the second column.

Notice the row and column sums of the probabilities for the alternative hypothesis above.

Capacity

No Capacity

Row sum

Control

0.10

0.40

0.5

Psychotic Group

0.15

0.35

0.5

Column sum

0.25

0.75

1

Now, under the null hypothesis, we expect the intervention not to make any difference so having the same 20% of people as in our control group with capacity, so we have

Capacity

No Capacity

Row sum

Control

0.125

0.375

0.5

Psychotic Group

0.125

0.375

0.5

Column sum

0.25

0.75

1

making sure that the marginals (row and column sums) are the same as those for the alternative hypothesis above which assumed 20% of participants had capacity (before the intervention).

0.375, 0.125, 0.375, 0.125

go into the first column.

Then you can calculate w = 0.115, and with power of 0.8, 1 degree of freedom, you need 589 individuals in total using the calculate button in G*POWER3.