Hi, Are there some packages which can generate multi-normal, multi-t, etc multivariate sampling? thanks! Best wishes, Peng ******************************* Peng Zhang Department of Biostatistics Harvard School of Public Health 655 Huntington Avenue Boston, Massachusetts 02115 ******************************* I believe I can fly I believe I can touch the sky
For multivariate normal and t distribution, install and try package "mvtnorm". Then look for ?rmvnorm and ?rmvt. Jerome On Saturday 15 February 2003 10:48, Peng Zhang wrote:> Content-Length: 501 > Status: R > X-Status: N > > Hi, > > Are there some packages which can generate multi-normal, multi-t, etc > multivariate sampling? thanks! > > Best wishes, > Peng > > ******************************* > Peng Zhang > Department of Biostatistics > Harvard School of Public Health > 655 Huntington Avenue > Boston, Massachusetts 02115 > ******************************* > > I believe I can fly > I believe I can touch the sky > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help-- Jerome Asselin (J?r?me) Statistical Analyst British Columbia Centre for Excellence in HIV/AIDS St. Paul's Hospital 608 - 1081 Burrard Street Vancouver, British Columbia CANADA V6Z 1Y6 Email: jerome at hivnet.ubc.ca Phone: 604 806-9112 Fax: 604 806-9044
Peng Zhang <pzhang at hsph.harvard.edu> writes:> Hi, > > Are there some packages which can generate multi-normal, multi-t, etc > multivariate sampling? thanks! > > Best wishes, > PengThis was discussed here in October. For the multivariate T you can use rmvt <- function(corr,df) rmvnorm(n,sigma=corr)/sqrt(rchisq(n,df)/df) (R.Koenker, correcting my suggestion). I believe rmvnorm came from the mvtnorm package but there's also mvrnorm in library(MASS). -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907