[R] Help with normal distribution in random samples...

Nordlund, Dan (DSHS/RDA) NordlDJ at dshs.wa.gov
Wed Jan 28 22:26:55 CET 2009


> -----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!!!
> 
> -Dan

Use 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
 
 




More information about the R-help mailing list