inst/doc/EmpiricalPCalibrationVignette.R

## ---- echo = FALSE, message = FALSE, warning = FALSE--------------------------
library(EmpiricalCalibration)

## -----------------------------------------------------------------------------
data(sccs)
drugOfInterest <- sccs[sccs$groundTruth == 1, ]
drugOfInterest
exp(drugOfInterest$logRr)
computeTraditionalP(drugOfInterest$logRr, drugOfInterest$seLogRr)

## -----------------------------------------------------------------------------
data(sccs)
negatives <- sccs[sccs$groundTruth == 0, ]
head(negatives)

## -----------------------------------------------------------------------------
plotForest(negatives$logRr, negatives$seLogRr, negatives$drugName)

## -----------------------------------------------------------------------------
null <- fitNull(negatives$logRr, negatives$seLogRr)
null

## -----------------------------------------------------------------------------
plotCalibration(negatives$logRr,negatives$seLogRr)

## -----------------------------------------------------------------------------
plotCalibrationEffect(negatives$logRr,negatives$seLogRr, null = null)

## -----------------------------------------------------------------------------
p <- calibrateP(null, drugOfInterest$logRr, drugOfInterest$seLogRr)
p

## -----------------------------------------------------------------------------
plotCalibrationEffect(negatives$logRr,
                      negatives$seLogRr, 
                      drugOfInterest$logRr, 
                      drugOfInterest$seLogRr, 
                      null)

## -----------------------------------------------------------------------------
null <- fitMcmcNull(negatives$logRr, negatives$seLogRr)
null

## -----------------------------------------------------------------------------
plotMcmcTrace(null)

## -----------------------------------------------------------------------------
p <- calibrateP(null, drugOfInterest$logRr, drugOfInterest$seLogRr)
p

## -----------------------------------------------------------------------------
plotCalibrationEffect(negatives$logRr,
                      negatives$seLogRr, 
                      drugOfInterest$logRr, 
                      drugOfInterest$seLogRr, 
                      null,
                      showCis = TRUE)

## ----evale=TRUE---------------------------------------------------------------
citation("EmpiricalCalibration")

Try the EmpiricalCalibration package in your browser

Any scripts or data that you put into this service are public.

EmpiricalCalibration documentation built on Aug. 9, 2022, 5:07 p.m.