So what you actually wnat is a multivariate normal distribution!
with mean c(20,40) and covariance matrix 
cbind(c(5,0.6*sqrt(5,10)),c(0.6*sqrt(5,10),10))
[Since Corr(x,y) = Cov(x,y)/sqrt(Var(x)*Var(y))


Look at the mvtnorm package, for function rmvnorm


Trying RSiteSearch("Multivariate normal distribution")
should also bring you to the package

Best regrads,
Kristel



Lisa Wang wrote:
> Hello there,
> 
> I would like to simulate X --Normal (20, 5)
>                          Y-- Normal (40, 10)
> 
> and the correlation between X and Y is 0.6. How do I do it in R?
> 
> Thank you very much
> 
> Lisa Wang Msc.
> Princess Margaret Hospital
> Toronto, Ca
> 
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
__________________________________________
Kristel Joossens        Ph.D. Student
Research Center ORSTAT  K.U. Leuven
Naamsestraat 69         Tel: +32 16 326929
3000 Leuven, Belgium    Fax: +32 16 326732
E-mail:  [EMAIL PROTECTED]
http://www.econ.kuleuven.be/public/ndbae49

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to