plotCalibration: Create a calibration plot

Description Usage Arguments Details Value Examples

View source: R/Plots.R

Description

plotCalibration creates a plot showing the calibration of our calibration procedure

Usage

1
2
plotCalibration(logRr, seLogRr, useMcmc = FALSE,
  legendPosition = "right", title, fileName = NULL)

Arguments

logRr

A numeric vector of effect estimates on the log scale

seLogRr

The standard error of the log of the effect estimates. Hint: often the standard error = (log(<lower bound 95 percent confidence interval>) - log(<effect estimate>))/qnorm(0.025)

useMcmc

Use MCMC to estimate the calibrated P-value?

legendPosition

Where should the legend be positioned? ("none", "left", "right", "bottom", "top")

title

Optional: the main title for the plot

fileName

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.

Details

Creates a calibration plot showing the number of effects with p < alpha for every level of alpha. The empirical calibration is performed using a leave-one-out design: The p-value of an effect is computed by fitting a null using all other negative controls. Ideally, the calibration line should approximate the diagonal. The plot shows both theoretical (traditional) and empirically calibrated p-values.

Value

A Ggplot object. Use the ggsave function to save to file.

Examples

1
2
3
data(sccs)
negatives <- sccs[sccs$groundTruth == 0, ]
plotCalibration(negatives$logRr, negatives$seLogRr)

OHDSI/EmpiricalCalibration documentation built on Nov. 28, 2018, 1:03 p.m.