showPearsonPower: Visualisation of the power of a Pearson correlation test

Description Usage Arguments Value Author(s) See Also Examples

View source: R/showPearsonPower.R

Description

This fuction is useful when conducting power analyses for a Pearson correlation. It draws the sampling distribution of Pearson's r assuming a null hypothesis value of r and assuming a the hypothetical population value. The probability of making a Type 1 error is also illustrated.

Usage

1
2
3
4
5
6
7
8
9
showPearsonPower(n = 100, rho = 0.3, rNull = 0,
                 distLabels = c("Null Hypothesis", "Population"),
                 rhoColor = "green", rhoFill = "green",
                 rhoAlpha = 0.1, rhoLineSize = 1,
                 rNullColor = "blue", rNullFill = "blue",
                 rNullAlpha = 0.1, rNullLineSize = 1,
                 type2Color = "red", type2Fill = "red",
                 type2Alpha = 0.1, type2LineSize = 0,
                 theme = dlvTheme(), alpha = 0.05, digits = 3)

Arguments

n

The number of participants.

rho

The value of the correlation coefficient in the population.

rNull

The value of the correlation coefficient according to the null hypothesis.

distLabels

Labels for the two distributions; the first one is the null hypothesis distribution, the second one the alternative distribution.

rhoColor, rNullColor, type2Color

The border colors of the distributions and the region used to illustrate the Type 2 error probability.

rhoFill, rNullFill, type2Fill

The fill colors of the distributions and the region used to illustrate the Type 2 error probability.

rhoAlpha, rNullAlpha, type2Alpha

The alpha (transparency) of the distributions and the region used to illustrate the Type 2 error probability.

rhoLineSize, rNullLineSize, type2LineSize

The line thicknesses of the distributions and the region used to illustrate the Type 2 error probability.

theme

The theme to use.

alpha

The significance level (alpha) of the null hypothesis test.

digits

The number of digits to round to.

Value

A ggplot plot is returned.

Author(s)

Gjalt-Jorn Peters

Maintainer: Gjalt-Jorn Peters <gjalt-jorn@userfriendlyscience.com>

See Also

didacticPlot

Examples

1
2
3
4
## Not run: 
showPearsonPower();

## End(Not run)

userfriendlyscience documentation built on May 2, 2019, 1:09 p.m.