R/Plots.R
plotExpectedType1Error.Rd
plotExpectedType1Error
creates a plot showing the expected type 1 error as a function of standard error.
plotExpectedType1Error(
logRrNegatives,
seLogRrNegatives,
seLogRrPositives,
alpha = 0.05,
null = NULL,
xLabel = "Relative risk",
title,
showCis = FALSE,
showEffectSizes = FALSE,
fileName = NULL
)
A numeric vector of effect estimates of the negative controls on the log scale.
The standard error of the log of the effect estimates of the negative controls.
The standard error of the log of the effect estimates of the positive controls.
The alpha (nominal type 1 error) to be used.
An object representing the fitted null distribution as created by the
fitNull
function. If not provided, a null will be fitted before
plotting.
If showing effect sizes, what label should be used for the effect size axis?
Optional: the main title for the plot
Show 95 percent credible intervals for the expected type 1 error.
Show the expected effect sizes alongside the expected type 1 error?
Name of the file where the plot should be saved, for example 'plot.png'.
See the function ggsave
in the ggplot2 package for supported file
formats.
A Ggplot object. Use the ggsave
function to save to file.
Creates a plot with the standard error on the x-axis and the expected type 1 error on the y-axis. The red line indicates the expected type 1 error given the estimated empirical null distribution if no calibration is performed. The dashed line indicated the nominal expected type 1 error rate, assuming the theoretical null distribution.
If standard errors are provided for non-negative estimates these will be plotted on the red line as yellow diamonds.
data(sccs)
negatives <- sccs[sccs$groundTruth == 0, ]
positive <- sccs[sccs$groundTruth == 1, ]
plotExpectedType1Error(negatives$logRr, negatives$seLogRr, positive$seLogRr)