CIV: Confidence Intervall Violin Plot

View source: R/CIV.R

CIVR Documentation

Confidence Intervall Violin Plot

Description

draws observations in metric variable for multiple groups, the group means, the 1-alpha confidence intervalls of the means and a density estimator (violin) of the distribution for every group.

Usage

CIV(
  x,
  y,
  alpha = 0.05,
  ylim = range(y) + c(-(range(y, na.rm = T)[2] - range(y, na.rm = T)[1])/5, (range(y,
    na.rm = T)[2] - range(y, na.rm = T)[1])/5),
  ylab = "",
  xlab = paste("|---| ", 100 * (1 - alpha), "% - confidence intervall", sep = ""),
  main = "",
  pch = 1 + as.numeric(factor(x)),
  col = "blue",
  colpoints = "grey",
  cex = 0.7,
  names = levels(factor(x)),
  jit = 0.2
)

Arguments

x

a categorial variable (independend variable)

y

a numeric variable (dependend variable)

alpha

error probability of confidence intervall

ylim

y axis limits

ylab

y axis label

xlab

x axis label

main

title

pch

point character

col

mean confidence intervall color

colpoints

point color

cex

point size

names

names of groups on x axis

jit

jitter intensity

Examples

x<-sample(paste("group",1:4),100,T)
y<-10+as.numeric(factor(x))*2+rnorm(length(x))
CIV(x,y,main="Confidence Intervall Violin Plot")

ingmarboeschen/graphing documentation built on Jan. 14, 2025, 7:32 a.m.