View source: R/EmpiricalCalibrationUsingAsymptotics.R
calibrateP | R Documentation |
calibrateP
computes calibrated p-values using the fitted null distribution
calibrateP(null, logRr, seLogRr, twoSided = TRUE, upper = TRUE, ...)
## S3 method for class 'null'
calibrateP(null, logRr, seLogRr, twoSided = TRUE, upper = TRUE, ...)
## S3 method for class 'mcmcNull'
calibrateP(
null,
logRr,
seLogRr,
twoSided = TRUE,
upper = TRUE,
pValueOnly,
...
)
null |
An object of class |
logRr |
A numeric vector of one or more 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) |
twoSided |
Compute two-sided (TRUE) or one-sided (FALSE) p-value? |
upper |
If one-sided: compute p-value for upper (TRUE) or lower (FALSE) bound? |
... |
Any additional parameters (currently none). |
pValueOnly |
If true, will return only the calibrated P-value itself, not the credible interval. |
This function computes a calibrated two-sided p-value as described in Schuemie et al (2014).
The calibrated p-value.
calibrateP(null)
: Computes the calibrated P-value using asymptotic assumptions.
calibrateP(mcmcNull)
: Computes the calibrated P-value and 95 percent credible interval using Markov Chain
Monte Carlo (MCMC).
Schuemie MJ, Ryan PB, Dumouchel W, Suchard MA, Madigan D. Interpreting observational studies: why empirical calibration is needed to correct p-values. Statistics in Medicine 33(2):209-18,2014
data(sccs)
negatives <- sccs[sccs$groundTruth == 0, ]
null <- fitNull(negatives$logRr, negatives$seLogRr)
positive <- sccs[sccs$groundTruth == 1, ]
calibrateP(null, positive$logRr, positive$seLogRr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.