Description Usage Arguments Details Examples
View source: R/EffectSize_Means.R
This function runs power calculations with two means of equal n, determining what effect size (in practical terms) is necessary to see a statistically significant effect. Results are printed and can also be assigned.
1 2 3 |
n |
The per-group sample size. Can be a single integer |
populationmean |
The population mean for the statistic in question. Required for all analyses. |
populationdev |
The population standard deviation for the statistic in question. Required for all analyses. |
alternative |
The type of hypothesis. Can be |
treatmentrate |
The proportion of those in the treatment group who are expected to complete treatment; see details. |
sig.level |
The significance level of the hypothetical test. Defaults to |
power |
The power of the hypothetical test. Defaults to |
The effect size input is a "practical" effect size in that it is the difference in means in observed units, unlike Cohen's d. The calculations adjust for treatment rate, so consider the effect size the mean effect among those who successfully receive treatment.
The treatment rate is used to (crudely) calculate the effect size. Assuming that those who do not receive treatment will be identical to the control group, the required effect size will need to be inversely proportional to the treatment rate. That is, if an effect of .1 is needed to see a significant effect, and only .9 of the treatment group receives treatment, the required effect size among those .9 treated becomes .1/.9 = .11.
"d" refers to Cohen's d, the formal score for effect size in tests of two means. In the output, Cohen's d is calculated after taking treatment rate into effect - it is the d for the full treatment group, including those who do not receive treatment. If the treatment rate is lower than 1, d will be lower.
Printed value is rounded; for an unrounded value, assign output to an object.
1 2 3 4 5 6 7 8 9 10 11 | Please refer to vignette for detailed examples.
#Determining required effect size given n, etc
EffectSize_Means(n = 100, populationmean = 50, populationdev = 10, alternative = "greater", treatmentrate = .8)
#Determining required effect size across multiple n's
EffectSize_Means(n = c(100, 200, 300), populationmean = 50, populationdev = 10, alternative = "greater", treatmentrate = .8)
#Assigning (unrounded) required effect size
e <- EffectSize_Means(n = 100, populationmean = 50, populationdev = 10, alternative = "greater", treatmentrate = .8)
e
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.