plot.plotB {clinDR}R Documentation

Plot Bayes dose response curve and dose group means

Description

Plot a dose response curve fit by Bayes MCMC methods (with optional posterior interval bars). Also plot dose group means (with optional CI bars)

Usage

## S3 method for class 'plotB'
plot( x,
	plotDif= FALSE, plotMed= FALSE, 
	plotResid=FALSE, predict= TRUE,
	logScale=FALSE,
	xlim,
	xat=NULL,
	ylim,  
	xlab, 
	ylab,labac='Act Comp',shapeac=8,colac='red',  
	symbolLabel='Group',symbolShape=8,
	symbolColor='red',symbolSize=4, ...)

Arguments

x

plotB object output from function plotB.

plotDif

Plot difference between doses and placebo. It is assumed the lowest dose is placebo. If activeControl, the difference is with the active control mean, and the active controls are not plotted.

plotMed

If TRUE, model-based curves are medians rather than means.

plotResid

If TRUE, a plot of the residuals formed from the dose group means minus the posterior dose group means.

predict

When predict=TRUE, predictive intervals for sample dose group proportions are plotted. They are gray-shaded bars.

logScale

If TRUE, log scale is used for dose.

xlim

x-axis limits

xat

The points at which tick-marks are to be drawn. Errors occur if the points are outside the range of xlim. By default (when NULL) tickmark locations are computed.

ylim

y-axis limits

xlab

x-axis label

ylab

y-axis label

labac

x-axis label for the active control group.

shapeac

Shape of the symbol for the active control group.

colac

Color of the symbol for the active control group.

symbolLabel

Label given to symbol in plot legend.

symbolShape

A character vector with names giving the shapes assigned to different levels of variable symbol. If a single shape is specified, it is replicated for all dose groups. See package ggplot2 for symbol mappings.

symbolColor

A character vector with names giving the colors assigned to different levels of variable symbol. If a single color is specified, it is replicated for all dose groups. See package ggplot2 for color mappings.

symbolSize

The size of the symbol for the dose group sample means. Set symbolSize=0 to supress plotting.

...

Additional parameters (not used)

Details

Produce additional plots from output of plotB without any re-computing. A plot is produced by default on return from the function. When active control is specified, the plot is 'printed' within the function. If there is a symbol group variable, it must be specified when plotB is executed. The symbol label, shape, color, and size must be re-specified in subsequent plot requests.

Value

ggplot object of the dose response curve, which will be plotted by default unless the output of the plot is assigned. When an active control group is present, the value returned is an invisible list with the ggplot for the dosing data, and a second ggplot for the ac data.

Note

PlotB can also be used with draws from a prior distribution to evaluate the prior dose response curve.

Author(s)

Neal Thomas

See Also

plotB, plotD, plot.fitEmax

Examples

## Not run: 
data("metaData")
exdat<-metaData[metaData$taid==6 & metaData$poptype==1,]

prior<-emaxPrior.control(epmu=0,epsca=100,difTargetmu=0,difTargetsca=100,dTarget=80.0,
        p50=3.75,sigmalow=0.01,sigmaup=20)
mcmc<-mcmc.control(chains=3)

msSat<-sum((exdat$sampsize-1)*(exdat$sd)^2)/(sum(exdat$sampsize)-length(exdat$sampsize))
fitout<-fitEmaxB(exdat$rslt,exdat$dose,prior,modType=4,
				count=exdat$sampsize,msSat=msSat,mcmc=mcmc)
parms<-coef(fitout)[,1:4]  #use first intercept

outB<-plotB(exdat$rslt,exdat$dose,parms, sigma2=(sigma(fitout))^2,
			ylab="Change in EDD")
			
plot(outB,plotDif=TRUE)

## End(Not run)


[Package clinDR version 2.4.1 Index]