All, Can someone help me create a skewed distribution, mean = 30, with probability of selecting a random number from the distribution greater than or equal 60 equal to 10%? I need the probability density function to equal zero at zero, and have a maximum height at or near 30. Is this possible? And if it is possible, how can I adjust the distribution so that the probability of selecting a random number greater than or equal to 60 is p. Thanks. No idea how to start. David [[alternative HTML version deleted]]
With skewed unimodal distributions, the mode can't equal the mean, so assuming you want the mean to be around 30, I find that a weibull function can get close to what you want:> mean(rweibull(1e5,1.5,33))[1] 29.77781> pweibull(60,1.5,33)[1] 0.9138475 I'm sure you can play with the parameters to try to get even closer to what you want. On Wed, Jun 10, 2009 at 2:48 AM, David Arnold<dwarnold45 at suddenlink.net> wrote:> All, > Can someone help me create a skewed distribution, mean = 30, with > probability of selecting a random number from the distribution greater > than or equal 60 equal to 10%? > > I need the probability density function to equal zero at zero, and > have ?a maximum height at or near 30. > > Is this possible? > > And if it is possible, how can I adjust the distribution so that the > probability of selecting a random number greater than or equal to 60 > is p. > > Thanks. No idea how to start. > > David > > > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Mike Lawrence Graduate Student Department of Psychology Dalhousie University Looking to arrange a meeting? Check my public calendar: http://tr.im/mikes_public_calendar ~ Certainty is folly... I think. ~
Your question is somewhat vague, there are probably an infinite number of distributions that fit your description. Here are 2 possibilities:> tmp <- sample( c(1,30,60), 10000000, replace=TRUE,+ prob=c(0.10344, 0.9-0.10344, 0.1))> mean(tmp)[1] 30.00041> mean(tmp>=60)[1] 0.1001004> > tmp2 <- rgamma(10000000, shape=1.777666, scale=30/1.777666) > mean(tmp2)[1] 29.99674> mean(tmp2>=60)[1] 0.0999903 -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of David Arnold > Sent: Tuesday, June 09, 2009 11:49 PM > To: r-help at r-project.org > Subject: [R] Creating a specific skewed distribution > > All, > Can someone help me create a skewed distribution, mean = 30, with > probability of selecting a random number from the distribution greater > than or equal 60 equal to 10%? > > I need the probability density function to equal zero at zero, and > have a maximum height at or near 30. > > Is this possible? > > And if it is possible, how can I adjust the distribution so that the > probability of selecting a random number greater than or equal to 60 > is p. > > Thanks. No idea how to start. > > David > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.