ciplot: Effect plot with multiple CIs for different groups

View source: R/ciplot.R

ciplotR Documentation

Effect plot with multiple CIs for different groups

Description

Uses grayplot() to plot a set of confidence intervals.

Usage

ciplot(
  est,
  se = NULL,
  lo = NULL,
  hi = NULL,
  SEmult = 2,
  labels = NULL,
  rotate = FALSE,
  ...
)

Arguments

est

Vector of estimates

se

Vector of standard errors

lo

Vector of lower values for the intervals

hi

Vector of upper values for the intervals

SEmult

SE multiplier to create intervals

labels

Labels for the groups (vector of character strings)

rotate

If TRUE, have group as y-axis; default (FALSE) has group on x-axis.

...

Optional graphics arguments

Details

Calls grayplot() with special choices of graphics parameters, as in dotplot().

Provide either se or both lo and hi. In the case that se is used, the intervals will be est +/- SEmult * se.

If labels is not provided, group names are taken from the names(est). If that is also missing, we use capital letters.

You can control the CI line widths with ci_lwd and the color of the CI segments with ci_col. You can control the width of the segments at the top and bottom with ci_endseg.

Value

None.

See Also

grayplot(), dotplot()

Examples


x <- rnorm(40, c(1,3))
g <- rep(c("A", "B"), 20)
me <- tapply(x, g, mean)
se <- tapply(x, g, function(a) sd(a)/sqrt(sum(!is.na(a))))
ciplot(me, se) # default is +/- 2 SE
ciplot(me, se, SEmult=1)
ciplot(me, se, rotate=TRUE)
lo <- me - 2*se
hi <- me + 2*se
ciplot(me, lo=lo, hi=hi)


broman documentation built on May 29, 2024, 7:18 a.m.

Related to ciplot in broman...