Barplot with confindence intervals

Share:

Description

Create barplots of a list of numeric values and error bars according to the confidence interval, standard deviation, interquartile range, etc.

Usage

1
2
3
4
5
6
ciplot(x, ...)

## Default S3 method:
ciplot(x, ..., ylim, height.fun = mean,
  height.args = list(), error.fun = confint, error.args = list(),
  arrows.args = list(code = 3, angle = 90), na.rm = TRUE)

Arguments

x

List of numeric values

...

Arguments forwarded to barplot in default method.

ylim

A range for the y-axis limits.

height.fun

Function to apply on each list object to calculate the height of the bars from.

height.args

Arguments forwarded to height.fun, as a named list.

error.fun

Function to calculate the error size. See also details.

error.args

Arguments forwarded to error.fun, as a named list.

arrows.args

Arguments forwarded to arrows, as a named list.

na.rm

Logical, remove missing values.

Details

Example for quantiles:
interquartile <- function(x) {quartile(x,.75)-mean(x)}
quantileQ <- function(x, q) {abs(quartile(x,q[1])-mean(x))}

Author(s)

Sven E. Templer