As we talked about previously, usually the 'sig.level' = 0.05 and 'power' = 0.8. In an ideal world, the power will be 0.8, which means that you have an 80% chance of detecting a significant result if one exists.
Calculate effect size:
Calculating the effect size for a correlation is very straight forward as it is r, or the correlation coefficient. In fact, you don't need to do anything at all, provided that you have calculated the correlation coefficient for your pilot study, or in any previous work on which you are basing your power analysis, the authors provide this information. You could of course work it out yourself if you would rather. The formula is:
where Xi and Yi and the paired samples, and X and Y are the sample means. Hopefully this won't be necessary though, as I am yet to see a stats programme that will not give you the correlation coefficient.
Cohen (1988) suggested that r values of 0.1, 0.3, and 0.5 represent small, medium, and large effect sizes respectively.
Calculate the sample size:
OK, so now we have the effect size, we can carry out the power analysis to calculate the required sample size. The basic command in library(pwr) in R is:
where n is the sample size in each group, r is the effect size, sig.level is the required p-value (usually 0.05) and power is the required power (usually 0.8).
So, if the effect size (r) = 0.3 (medium effect), the sig.level and power are set at 0.05 and 0.8 respectively, R calculates the effect size as:
which means that in order for me to be 80% confident that I will detect the r = 0.3 effect size at the 0.05 level, I will need a minimum of 85 subjects. Note that I left the 'n = ...' command out as that is what I want R to tell me.
That is quite a lot! What happens if I only have 50 subjects at my disposal. Well, let's ask R. Note that this time, I will put the 'n = ...' in as I know what I have. I also want to know what the likelihood of me detecting the effect is with my sample size, so I leave out the 'power = 0.8' command.
That is quite a lot! What happens if I only have 50 subjects at my disposal. Well, let's ask R. Note that this time, I will put the 'n = ...' in as I know what I have. I also want to know what the likelihood of me detecting the effect is with my sample size, so I leave out the 'power = 0.8' command.
This means that if you run the experiment, you can only be 56% confident that you will detect the effect at p=0.05. Time to re-design your study I think!