Sea Captain 1779
2009-Jan-28 20:04 UTC
[R] Help with normal distribution in random samples...
Hi!!! First time 'R' user looking for a little assistance. Here is what I have so far: practice1 = matrix ((runif(5000, min =0, max = 12)), 100) which is creating 50 samples, for 100 cases, distributed between 0-12. What I would like is to be able to set the mean and SD so that the data is normally distributed around lets say 7. Any help I can get with achieving that goal would be greatly appreciated!!! -Dan -- View this message in context: http://www.nabble.com/Help-with-normal-distribution-in-random-samples...-tp21713636p21713636.html Sent from the R help mailing list archive at Nabble.com.
Mike Lawrence
2009-Jan-28 21:23 UTC
[R] Help with normal distribution in random samples...
?rnorm On Wed, Jan 28, 2009 at 4:04 PM, Sea Captain 1779 <dbowen at measinc.com> wrote:> > Hi!!! > > First time 'R' user looking for a little assistance. Here is what I have so > far: > > practice1 = matrix ((runif(5000, min =0, max = 12)), 100) > > which is creating 50 samples, for 100 cases, distributed between 0-12. What > I would like is to be able to set the mean and SD so that the data is > normally distributed around lets say 7. Any help I can get with achieving > that goal would be greatly appreciated!!! > > -Dan > -- > View this message in context: http://www.nabble.com/Help-with-normal-distribution-in-random-samples...-tp21713636p21713636.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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 www.thatmike.com Looking to arrange a meeting? Check my public calendar: http://www.thatmike.com/mikes-public-calendar ~ Certainty is folly... I think. ~
Nordlund, Dan (DSHS/RDA)
2009-Jan-28 21:26 UTC
[R] Help with normal distribution in random samples...
> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of Sea Captain 1779 > Sent: Wednesday, January 28, 2009 12:04 PM > To: r-help at r-project.org > Subject: [R] Help with normal distribution in random samples... > > > Hi!!! > > First time 'R' user looking for a little assistance. Here is > what I have so > far: > > practice1 = matrix ((runif(5000, min =0, max = 12)), 100) > > which is creating 50 samples, for 100 cases, distributed > between 0-12. What > I would like is to be able to set the mean and SD so that the data is > normally distributed around lets say 7. Any help I can get > with achieving > that goal would be greatly appreciated!!! > > -DanUse rnorm() instead of runif(). Hope this is helpful, A different Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204