CIplot_uni: Univariate confidence plots

View source: R/CIplot_uni.r

CIplot_uniR Documentation

Univariate confidence plots

Description

Draws univariate confidence plots of single variables

Usage

CIplot_uni(data, group=NA, names=colnames(data), group.order=NA, 
           cols=rainbow(ncol(data)), ylim=c(NA,NA), cex=1, 
           pch=rep(21, ncol(data)), fg=rainbow(ncol(data)), bg="white", 
           shade=FALSE, alpha.f=0.2, horizon=FALSE, nperm=1000, 
           conf=0.5, CONF=0.95, thin=1, end=1, main="", ylab="") 

Arguments

data

matrix with data in columns (if not a matrix, then it is a vector with corresponding grouping variable group)

group

Grouping variable (if data is a vector)

names

labels for variables; if data is a matrix then by default the column names of data

group.order

group names in order preferred in plot

cols

Vector of colours for different variables (or groups)

ylim

Possible new y-limits for plot (after seeing first attempt at plotting))

cex

Expansion factor for symbols

pch

alternative set of symbols for samples, otherwise small filled circles (pch=21)

fg

colours for symbols

bg

colours for possible fill colour

shade

=TRUE for ellipse shading (default=FALSE)

alpha.f

shading factor, by default=0.2 (should be between 0 and 1)

horizon

TRUE if horizontal gray dashed lines required at "nice" y-values, not implemented yet

nperm

number of replicates for bootstrap sampling (default is 1000)

conf

confidence level for box, default 50% (0.5)

CONF

confidence level for whiskers, default 95% (0.95)

thin

by default=1, adjust for fatter or thinner boxes

end

by default=1, adjust for wider or narrower ends of whiskers

main

title for figure

ylab

y-axis label

Details

The function CIplot_uni plots univariate confidene intervals, called confidence plots, using bootstrapping. It is mainly for plotting several confidence plots alongside one another. These could be based on different variables in the columns of a matrix or groups of variables defined on a single vector. The package boot is required.

Author(s)

Michael Greenacre

References

Greenacre, M. (2016), Data reporting and visualization in ecology, Polar Biology, 39:2189-2205.

See Also

DOT, BAR, CIplot_biv

Examples

# Generate two normal variables in three groups with different means
# Means (1,0), (0,1) and (0,0)
means  <- matrix(c(1,0,0,1,0,0), ncol=3)
data   <- matrix(nrow=300, ncol=2)
groups <- sample(rep(c(1,2,3), 100))
for(i in 1:300) data[i,] <- rnorm(c(1,1), mean=means[,groups[i]])
# Confidence plots of first and second variable, with shading
require(boot)
CIplot_uni(data[,1], group=groups, shade=TRUE, ylim=c(-0.5,1.5), main="First variable")
CIplot_uni(data[,2], group=groups, shade=TRUE, ylim=c(-0.5,1.5), main="Second variable")

easyCODA documentation built on Nov. 24, 2026, 1:07 a.m.