[R] (no subject)

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Sat Feb 15 20:22:03 CET 2003


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,
> Peng

This 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




More information about the R-help mailing list