Der Violin-Plot (gibt es eine deutsche Bezeichnung? Violinen-Diagramm?) ist eine Weiterentwicklung des Boxplots. Er wurde 1998 vorgestellt [1]Hintze, Jerry L. & Nelson, Ray D. 1998. Violin Plots: A Box Plot-Density Trace Synergism. The American Statistician 52(2), 181–184. DOI: 10.1080/00031305.1998.10480559Besten Dank an Holger … Continue reading und soll die Visualisierung der Verteilungen verbessern. Das Boxplot-Skript kann man durch Ersetzung einer einzigen Funktion in ein Violinplot-Skript verwandeln:
# Pakete laden library(ggplot2) # Daten aus CSV-Datei einlesen apc <- read.csv('https://raw.githubusercontent.com/OpenAPC/openapc-de/master/data/apc_de.csv', encoding = "UTF-8", sep=",", header = TRUE) # Daten auswählen apc <- apc[, c("Institution", "EURO", "Period")] # Nur noch drei Spalten apc <- apc[apc$Institution == "Hannover U", ] # Nur noch Uni Hannover # Boxplot erstellen box <- ggplot(apc, aes(x = Institution, y = EURO)) box <- box + geom_boxplot() box # Ausgabe # Violinen-Plot erstellen vio <- ggplot(apc, aes(x = Institution, y = EURO)) vio <- vio + geom_violin() vio # Ausgabe |
Ich habe den Boxplot zur besseren Vergleichbarkeit im Skript belassen.
Ergebnis:
Aus der englischen Wikipedia:
The violin plot is similar to box plots, except that they also show the probability density of the data at different values (in the simplest case this could be a histogram). Typically violin plots will include a marker for the median of the data and a box indicating the interquartile range, as in standard box plots. Overlaid on this box plot is a kernel density estimation.
Dieses war der zweite Plot, und der nächste folgt sofott.
Disclaimer: Dies ist eine äußerst laienhafte Erklärung!
References
↑1 | Hintze, Jerry L. & Nelson, Ray D. 1998. Violin Plots: A Box Plot-Density Trace Synergism. The American Statistician 52(2), 181–184. DOI: 10.1080/00031305.1998.10480559 Besten Dank an Holger für den Hinweis! |
---|
Ein Gedanke zu „Was ist ein Violin-Plot?“
Kommentare sind geschlossen.