Skip to contents

Draws the power of the design with blinded sample size re-estimation of StratPowerBSSR and that of the fixed design against a chosen column of the scenarios, as plot.bbssr_powerbssr does for two groups.

Usage

# S3 method for class 'bbssr_spowerbssr'
plot(x, x.by = NULL, xlab = NULL, ...)

Arguments

x

An object of class bbssr_spowerbssr returned by StratPowerBSSR

x.by

Name of the numeric column of x on the horizontal axis, or 'scenario' for the rows of p that the scenarios come from. The default of NULL takes the first of the true pooled response probabilities p.S1, p.S2, ... that varies between the scenarios, or the scenario when none varies

xlab

Label of the horizontal axis. NULL makes it from x.by and a single NA drops it

...

Further arguments of plot.bbssr_powerbssr: main, sub, ylab, ylim, ref.line, legend.title, legend.labels, show.points, colours and base_size

Value

A ggplot object

Details

The lines join the scenarios in the order of the horizontal axis, so the scenarios should differ in a single probability, or x.by should name a column in which they all differ; a warning is given when two scenarios share a value on the axis.

The Monte Carlo standard errors of a simulated or averaged power (three or more strata, or a random allocation) are not drawn. With Delta.T = 0 in StratPowerBSSR the curves are rejection probabilities under the null hypothesis, and ref.line can be set to the level of significance.

Examples

res <- StratPowerBSSR(p = cbind(0.4, seq(0.3, 0.7, by = 0.1)), Delta.A = 0.3,
                      Delta.T = 0.3, N1 = c(10, 10), N2 = c(10, 10), omega = 0.5,
                      r = 1, alpha = 0.05, tar.power = 0.8, Test = 'CMH',
                      ss.method = 'standard')
plot(res)