0

I am looking for help to create a left-skewed distribution giving a specific mean and standard deviation. EnvStats package has a function to creates bounded right-skewed distribution as shown below with mean=2, sd=.9, lb=1,ub=5, but not left-skewed.

library(EnvStats)
set.seed(20)
# Rigth skewed
x <- rlnormTruncAlt(100, 2, .9, 1, 5)
hist(x)
mean(x)
skewness(x)
www
  • 38,575
  • 12
  • 48
  • 84
Alan
  • 55
  • 1
  • 6
  • 1
    Beta distribution is bounded and can become skewed in either direction depending on the parameters. – Kota Mori Nov 30 '16 at 06:11
  • Why not use EnvStats with the mean adjusted to the complementary location in the range, then just flip the distribution end-for-end? – pjs Nov 30 '16 at 23:53
  • @pjs I am not sure how to do it! any suggestions? Thank you – Alan Dec 01 '16 at 01:12
  • If your bounded range is [0, 5] and you want a mean of 4, generate a right-skewed distribution on [0, 5] with a mean of 1. You want the complementary mean to be as far from the midpoint (2.5) as the target mean. Then transform every X to (5-X), which flips the distribution right-to-left. More generally, if the range is not bounded by zero you can subtract the midrange from each value, flip its sign, and then add the midrange back to flip a distribution. – pjs Dec 01 '16 at 02:51

0 Answers0