Learn R Programming

denstrip (version 1.5.4)

cistrip: Line drawings of point and interval estimates

Description

Adds one or more points and lines to a plot, representing point and interval estimates.

Usage

cistrip(x, at, d, horiz=TRUE, pch = 16, cex = 1, lattice=FALSE, …)
panel.cistrip(...)

Arguments

x

Either a vector of three elements corresponding to point estimate, lower limit and upper limit of the interval estimate, respectively, or a numeric matrix or data frame with three columns representing point estimates, lower and upper limits.

at

Position of the line on the y-axis (if horiz=TRUE) or the x-axis (if horiz=FALSE).

d

Length of the serifs at each end of the line. Defaults to 1/60 of the axis range.

horiz

Draw the line horizontally (TRUE) or vertically (FALSE).

pch

Character to draw at the point estimate, see points. By default this is a small solid circle, pch=16.

cex

Expansion factor for the character at the point estimate, for. A vector can be supplied here, one for each estimate, as in pch. Useful for meta-analysis forest plots.

lattice

Set this to TRUE to make cistrip a lattice panel function instead of a base graphics function. panel.cistrip(x,...) is equivalent to cistrip(x, lattice=TRUE, ...).

Further arguments passed to the points and segments functions or their lattice equivalents. For example lty,lwd to set the style and thickness of the line.

See Also

denstrip, vwstrip, bpstrip

Examples

Run this code
# NOT RUN {
## One estimate 
x <- c(0.1, -2, 2)
plot(0, type="n", xlim=c(-5, 5), ylim=c(-5, 5), xlab="", ylab="")
abline(h=0, lty=2, col="lightgray")
abline(v=0, lty=2, col="lightgray")
cistrip(x, at=-0.1)
cistrip(x, at=0.2, lwd=3, d=0.1)
cistrip(x, at=-4, horiz=FALSE, lwd=3, d=0.2)

## Double / triple the area of the central point, as in forest plots
cistrip(x, at=2, d=0.2, pch=22, bg="black")
cistrip(x, at=2.5, d=0.2, pch=22, bg="black", cex=sqrt(2))
cistrip(x, at=3, d=0.2, pch=22, bg="black", cex=sqrt(3))

## Several estimates
x <- rbind(c(0.1, -2, 2), c(1, -1, 2.3),
           c(-0.2, -0.8, 0.4), c(-0.3, -1.2, 1.5))
plot(0, type="n", xlim=c(-5, 5), ylim=c(-5, 5), xlab="", ylab="")
cistrip(x, at=1:4)
abline(v=0, lty=2, col="lightgray")
cistrip(x, at=1:4, horiz=FALSE, lwd=3, d=0.2)
abline(h=0, lty=2, col="lightgray")
# }

Run the code above in your browser using DataLab