Elaborerò il mio commento, come suggerito da @gung. Includerò anche la trama del violino suggerita da @Alexander, per completezza. Alcuni di questi strumenti possono essere utilizzati per confrontare più di due campioni.
# Required packages
library(sn)
library(aplpack)
library(vioplot)
library(moments)
library(beanplot)
# Simulate from a normal and skew-normal distributions
x = rnorm(250,0,1)
y = rsn(250,0,1,5)
# Separated histograms
hist(x)
hist(y)
# Combined histograms
hist(x, xlim=c(-4,4),ylim=c(0,1), col="red",probability=T)
hist(y, add=T, col="blue",probability=T)
# Boxplots
boxplot(x,y)
# Separated smoothed densities
plot(density(x))
plot(density(y))
# Combined smoothed densities
plot(density(x),type="l",col="red",ylim=c(0,1),xlim=c(-4,4))
points(density(y),type="l",col="blue")
# Stem-and-leaf plots
stem(x)
stem(y)
# Back-to-back stem-and-leaf plots
stem.leaf.backback(x,y)
# Violin plot (suggested by Alexander)
vioplot(x,y)
# QQ-plot
qqplot(x,y,xlim=c(-4,4),ylim=c(-4,4))
qqline(x,y,col="red")
# Kolmogorov-Smirnov test
ks.test(x,y)
# six-numbers summary
summary(x)
summary(y)
# moment-based summary
c(mean(x),var(x),skewness(x),kurtosis(x))
c(mean(y),var(y),skewness(y),kurtosis(y))
# Empirical ROC curve
xx = c(-Inf, sort(unique(c(x,y))), Inf)
sens = sapply(xx, function(t){mean(x >= t)})
spec = sapply(xx, function(t){mean(y < t)})
plot(0, 0, xlim = c(0, 1), ylim = c(0, 1), type = 'l')
segments(0, 0, 1, 1, col = 1)
lines(1 - spec, sens, type = 'l', col = 2, lwd = 1)
# Beanplots
beanplot(x,y)
# Empirical CDF
plot(ecdf(x))
lines(ecdf(y))
Spero che aiuti.
hist
,; densità levigatedensity
; Grafici QQqqplot
; trame stelo-foglia (un po 'antiche)stem
. Inoltre, il test di Kolmogorov-Smirnov potrebbe essere un buon complementoks.test
.