Idealized Plot of two overlapping distributions with different skewness?
In order to show the effect of increasing right skewness I want to create
two overlapping plots where one distribution is more right skewed than the
other.
So I do something like the following
tmp1fun <- function(m1=0,m2=1,m3=-0.2,m4=3.7,n=20000) {
parms <- JohnsonFit(c(m1,m2,m3,m4), 'use')
rJohnson(n,parms) }
data1.dens <-
rbind(data.frame(var1=rep('now',50000),y=tmp1fun(m3=-0.2,n=50000))
,data.frame(var1=rep('hist',50000),y=tmp1fun(m3=0.2,n=50000)))
library(ggplot2)
ggplot(data1.dens, aes(y, fill = var1))+
geom_density(alpha = 0.5) + coord_cartesian(xlim=c(-4, 4))
However it doesn't look right, it looks more like the mean of the
distribution is shifted with regards to the other. Also I'd kind of like
the density plot to look a bit smoother.
So my question has two parts 1. What distribution and what parameters
should I use so that one distribution looks similar to the other, but just
more right skewed? 2. What is the best graphics tool for producing this
plot? If possible I'd like a filled chart rather than just a line, and
perhaps a higher bandwidth with the smoother.
Thanks for any hints or suggestions.
No comments:
Post a Comment