[R] Generating bivariate or multivariate data with known parameter values

Dimitrios Rizopoulos Dimitris.Rizopoulos at med.kuleuven.be
Sun Oct 8 20:35:05 CEST 2006


you can do that using the copula package, e.g.,

library(copula)
bivGamma <- mvdc(claytonCopula(2), c("gamma", "gamma"),
         list(list(shape = 1, rate = 2), list(shape = 2, rate = 1)))
dat <- rmvdc(bivGamma, 1000)

regarding correlation, the Clayton copula with alpha = 2 gives  
Kendall's tau = 0.5, i.e.,

cor(dat, method = "kendall")


I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
      http://www.student.kuleuven.be/~m0390867/dimitris.htm


Quoting David Kaplan <dkaplan at education.wisc.edu>:

> Greetings,
>
> I'm interested in generating data from various bivariate or
> mulitivariate distributions (e.g. gamma, t, etc), where I can specify
> the parameter values, including the correlations among the variables.  I
> haven't been able to dig anything up on the faq, but I probably missed
> something.  A nudge in the right direction would be appreciated.
>
> David
>
>
> --
> ========================================================================
> David Kaplan, Ph.D.
> Professor
> Department of Educational Psychology
> University of Wisconsin - Madison
> Educational Sciences, Room 1061
> 1025 W. Johnson Street
> Madison, WI 53706
>
> email: dkaplan at education.wisc.edu
> Web:   http://www.education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm
> Phone: 608-262-0836
> Fax:   608-262-0843
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



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



More information about the R-help mailing list