View source: R/class_analysis_results.R
plot.AnalysisResults | R Documentation |
Plots the conditional power together with the likelihood function.
## S3 method for class 'AnalysisResults'
plot(
x,
y,
...,
type = 1L,
nPlanned = NA_real_,
allocationRatioPlanned = NA_real_,
main = NA_character_,
xlab = NA_character_,
ylab = NA_character_,
legendTitle = NA_character_,
palette = "Set1",
legendPosition = NA_integer_,
showSource = FALSE,
grid = 1,
plotSettings = NULL
)
x |
The analysis results at given stage, obtained from |
y |
Not available for this kind of plot (is only defined to be compatible to the generic plot function). |
... |
Optional plot arguments. Furthermore the following arguments can be defined:
|
type |
The plot type (default = 1). Note that at the moment only one type (the conditional power plot) is available. |
nPlanned |
The additional (i.e., "new" and not cumulative) sample size planned for each of the subsequent stages. The argument must be a vector with length equal to the number of remaining stages and contain the combined sample size from both treatment groups if two groups are considered. For survival outcomes, it should contain the planned number of additional events. For multi-arm designs, it is the per-comparison (combined) sample size. For enrichment designs, it is the (combined) sample size for the considered sub-population. |
allocationRatioPlanned |
The planned allocation ratio |
main |
The main title, default is |
xlab |
The x-axis label, default is |
ylab |
The y-axis label. |
legendTitle |
The legend title, default is |
palette |
The palette, default is |
legendPosition |
The position of the legend.
By default (
|
showSource |
Logical. If
Note: no plot object will be returned if |
grid |
An integer value specifying the output of multiple plots.
By default ( |
plotSettings |
An object of class |
The conditional power is calculated only if effect size and sample size is specified.
Returns a ggplot2
object.
## Not run:
design <- getDesignGroupSequential(kMax = 2)
dataExample <- getDataset(
n = c(20, 30),
means = c(50, 51),
stDevs = c(130, 140)
)
result <- getAnalysisResults(design = design,
dataInput = dataExample, thetaH0 = 20,
nPlanned = c(30), thetaH1 = 1.5, stage = 1)
if (require(ggplot2)) plot(result, thetaRange = c(0, 100))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.