Learn R Programming

NCA (version 5.0.0)

nca_powerplot: Function to show the powerplot

Description

Function to show the powerplot, optional over various variables.

Usage

nca_powerplot(df_power, x.variable = 'n', x.name = 'Sample size',
            x.min = 0, x.max = NULL,
            line.variable = 'ES', line.name = 'Effect size')

Arguments

df_power

Dataframe as returned by the nca_power function.

x.variable

The variable to use for the X scale, default is sample size.

x.name

The name for the X scale.

x.min

The minimum value for the X scale, defaults to 0.

x.max

The maximum value for the X scale, defaults to the maximum X.

line.variable

Variable that represented the line.

line.name

The name of the variable that represented the line.

Examples

Run this code
# Simple example, showing a normal plot with the power as a function of the sample size
# A line for each effect size will be shown
if (FALSE) results <- nca_power(effect = c(.1, .2, .3))
results <- nca_power(effect = c(.1, .2, .3), rep=2, test.rep = 1)
nca_powerplot(results)

# This example shows the power for different ceiling lines
if (FALSE) results <- nca_power(ceiling = c("ce_fdh", "cr_fdh"))
results <- nca_power(ceiling = c("ce_fdh", "cr_fdh"), rep=2, test.rep = 1)
powerplot <- nca_powerplot(results, line.variable='ceiling', line.name='Ceiling')

Run the code above in your browser using DataLab