Learn R Programming

BayesianHybridDesign (version 0.1.0)

plotPMD: Plot Posterior Mean Difference (PMD) Distributions

Description

Plots the density of the posterior mean difference between the hybrid and concurrent control arms, based on an object from power.DPP(). Can compare one or two such objects on the same plot.

Usage

plotPMD(o, o2 = NULL)

Value

Invisibly returns a list containing summary statistics. The structure of the list depends on whether o2 is provided.

  • If o2 is NULL: A list with a scalar mean_PMD, a scalar sd_PMD, and a numeric vector CI95_PMD.

  • If o2 is provided: A list with numeric vectors for mean_PMD and sd_PMD, and a matrix for CI95_PMD, with each row corresponding to an input object.

Arguments

o

An object produced by the power.DPP() function.

o2

(Optional) A second object from power.DPP() to compare on the same plot. Default is NULL.

Examples

Run this code
# nsim reduced for faster example
o1a <- power.DPP(pt=0.65, nt=60, pc=0.45, nc=30, pc.calib=0.45,
                 pch=0.45, nche=60, nch=200, alpha=0.1, nsim=1000)
o1b <- power.DPP(pt=0.65, nt=60, pc=0.45, nc=30, pc.calib=0.45,
                 pch=0.45, nche=30, nch=200, alpha=0.1, nsim=1000)

# Plot a single object
stats1 <- plotPMD(o=o1a)

# Plot two objects for comparison
stats2 <- plotPMD(o=o1a, o2=o1b)

Run the code above in your browser using DataLab