How to generate random values from a normal distribution with specific mean in R -


i have book equation, not sure how translate code in r. wondering if provide example.

enter image description here

i want generate random values distribution.

you can use rnorm generate random values:

set.seed(100) mu <- 5 # or whatever mean n <- 10 # number of random values wish generate.  x <- rnorm(n, mean = mu) #the function's default standard deviation 1 x  [1] 4.497808 5.131531 4.921083 5.886785 5.116971 5.318630 4.418209 5.714533 [9] 4.174741 4.640138 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -