Description Usage Arguments Value References Examples
A Student CI plot (or Violin CI plot) is a mirrored density plot similar to violin plot
but instead of kernel density estimate it is based on the density of the tdistribution.
It can be though of as a continuous "confidence interval density" (hence the name),
which could reduce the dichotomous interpretations due to a fixed confidence level.
geom_student
can also be used to draw Gradient CI plots (using argument type
),
which replaces the violin shaped density with a rectangle.
1 2 3 
mapping 
Set of aesthetic mappings created by 
data 
The data to be displayed in this layer. There are three options: If A A 
position 
Position adjustment, either as a string, or the result of a call to a position adjustment function. 
width 
Scaling parameter for the width of the violin/rectangle. 
type 
Type of the plot. The default is 
scale 
If 
draw_lines 
If not 
draw_mean 
If 
show.legend 
logical. Should this layer be included in the legends?

inherit.aes 
If 
... 
Other arguments passed to 
A ggplot object.
Helske, J, S Helske, M Cooper, A Ynnerman, and L Besançon (2020). Are You Sure You’re Sure?  Effects of Visual Representation on the Cliff Effect in Statistical Inference. Under review. https://arxiv.org/abs/2002.07671
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28  library("dplyr")
library("ggplot2")
library("scales")
ci_levels < c(0.999, 0.95, 0.9, 0.8, 0.5)
n < length(ci_levels)
ci_levels < factor(ci_levels, levels = ci_levels)
PlantGrowth %>% dplyr::group_by(group) %>%
dplyr::summarise(
mean = mean(weight),
df = dplyr::n()  1,
se = sd(weight)/sqrt(df + 1)) %>%
dplyr::full_join(
data.frame(group =
rep(levels(PlantGrowth$group), each = n),
level = ci_levels), by = "group") > d
p < ggplot(data = d, aes(group)) +
geom_student(aes(mean = mean, se = se, df = df,
level = level, fill = level), draw_lines = c(0.95, 0.5))
p
g < scales::seq_gradient_pal("#e5f5f9", "#2ca25f")
p + scale_fill_manual(values=g(seq(0,1,length = n))) + theme_bw()
p2 < ggplot(data = d, aes(group)) +
geom_student(aes(mean = mean, se = se, df = df,
level = level, fill = level), type = "box", draw_lines = c(0.95, 0.5))
p2

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.