Plotting a Skewed Distribution

119 Views Asked by At

I need to plot a slightly skewed dataset. I'd imagine there is a formula like:

f(x, mean, stddev, skew, ...etc) = y

But I can't find anything that specific. For example, I may get these parameters:

mean: 8.07
stddev: 1.18
pearson_skew: -0.64

and I'd like to plot a curve. I'm not sure I'm calculating the right parameters or if this is a bad idea all-together, so forgive my ignorance.

For context, the data is coming from a large dataset in a RDMS and the plot needs to be rendered on a browser (without access to the original dataset).

2

There are 2 best solutions below

1
On

There are an infinite number of distributions that have a given mean, standard deviation, and skew. The skew-normal distribution is just one of them:

skew-normal

0
On

Plotting the density of a skew-normal distribution can be done by the dsn function in the sn package. Have a look here. However, you might need to match your parameters of interest to the input arguments in those functions.