Want to create a variable x using rnorm, but not sure how to represent the standard deviation in code.
Help would be appreciated thanks!
Want to create a variable x using rnorm, but not sure how to represent the standard deviation in code.
Help would be appreciated thanks!
x <- rnorm(n = 100, mean = 0, sd = 1)
This will give you a vector x of length 100 distributed normally with a mean of 0 and a standard deviation of 1. You can use ? preceding any R function to pull up the help documentation. For example: ?rnorm().