create_contour: Plot a power contour

Description Usage Arguments Value Examples

View source: R/plot.R

Description

This is the function which creates the contours from a set of values. These can either be generated with the contourcalc functions, or with any custom values derived from, for example, simulations.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
create_contour(
  x,
  y,
  pwr,
  pwrcolours = seq(0, 1, by = 0.1),
  xlab = "Sample size",
  ylab = "Hypothetical effect size",
  pwrbands = c(0.5, 0.8, 0.95),
  alpha = 0.6
)

Arguments

x

The x values.

y

The y values.

pwr

The power values.

pwrcolours

The breaks for the power bands. Defaults to seq(0,1,0.1).

xlab

The label of the x axis.

ylab

The label of the y axis.

pwrbands

The additional black power bands. Defaults to c(0.5, 0.8, 0.95).

alpha

The transparency of the contour for seeing the grid lines underneath.

Value

A ggplot2 object.

Examples

1
2
vals <- pwrcontour:::pwr.t.test_contourcalc(5, 50, 0.3, 0.7)
create_contour(vals$n, vals$ES, vals$power, xlab="x", ylab="y")

mathesong/pwrcontour documentation built on Jan. 1, 2021, 9:19 a.m.