plot.ci: Plot confidence intervals

View source: R/plot.ci.R

plot.ciR Documentation

Plot confidence intervals

Description

Function to plot confidence intervals

Usage

## S3 method for class 'ci'
plot(x, xlim, xlab = "", labels, ...)

Arguments

x

List, data.frame or other object of this form containing point estimates (first element) and the corresponding confidence intervals as elements lower and upper.

xlim

Limit of the x-axis

xlab

Label for the y-axis

labels

labels

...

Used to transport arguments to plotConfidence.

Details

Function to plot means and other point estimates with confidence intervals

Author(s)

Thomas A. Gerds <tag@biostat.ku.dk>

Examples


data(Diabetes)
x=ci.mean(bp.2s~AgeGroups,data=Diabetes)
plot(x,title.labels="Age groups",xratio=c(0.4,0.3))
x=ci.mean(bp.2s/500~AgeGroups+gender,data=Diabetes)
plot(x,xratio=c(0.4,0.2))
plot(x,xratio=c(0.4,0.2),
     labels=split(x$labels[,"AgeGroups"],x$labels[,"gender"]),
     title.labels="Age groups")
## Not run: 
plot(x, leftmargin=0, rightmargin=0)
plotConfidence(x, leftmargin=0, rightmargin=0)

data(CiTable)
with(CiTable,plotConfidence(x=list(HazardRatio),
                               lower=lower,
                               upper=upper,
                               labels=CiTable[,2:6],
                               factor.reference.pos=c(1,10,19),
                               format="(u-l)",
                               points.col="blue",
                               digits=2))

with(CiTable,Publish::plot.ci(x=list(HazardRatio),
                               lower=lower,
                               upper=upper,
                               labels=CiTable[,2:6],
                               factor.reference.pos=c(1,10,19),
                               format="(u-l)",
                               points.col="blue",
                               digits=2,
                               leftmargin=-2,
                               title.labels.cex=1.1,
                               labels.cex=0.8,values.cex=0.8))

## End(Not run)

Publish documentation built on Jan. 18, 2023, 1:08 a.m.