[R] How do I generate a random sample with an given variance?

Mark Myatt mark at myatt.demon.co.uk
Tue Mar 27 11:23:23 CEST 2001


pooh rondstr <poohtest at yahoo.com> writes:
>Hi R gurus,
>
>
>How do I generate a random sample with  a given
>variance?

Form the standard normal ... for 100 numbers with a mean of 5 and a
standard deviation of 2:

        rnorm(100, mean = 5, sd = 2)

Mark


--
Mark Myatt


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list