Re: [R] Generating artificial datasets with a specific correlation coefficient.

From: James R. Milks <james.milks_at_wright.edu>
Date: Thu, 14 Jun 2007 07:00:07 -0400

Thanks to all who responded to my request. I'll probably use the corgen function in ecodist, as suggested by Sarah Goslee (below), as I just need examples of correlated vectors.

Thanks again.

Jim Milks

Graduate Student
Environmental Sciences Ph.D. Program
136 Biological Sciences
Wright State University
3640 Colonel Glenn Hwy
Dayton, OH 45435

Begin forwarded message:

> From: Sarah Goslee <sarah.goslee_at_gmail.com>
> Date: June 12, 2007 5:37:36 PM EDT
> To: James Milks <james.milks_at_wright.edu>
> Subject: Re: [R] Generating artificial datasets with a specific
> correlation coefficient.
>
> If you don't need anything fancy, just two vectors x and y
> such that cor(x, y) = 0.30 then the corgen function in
> ecodist (current version available from CRAN) does just that.
>
> Sarah
>
> On 6/12/07, James Milks <james.milks_at_wright.edu> wrote:
>> I need to create artificial datasets with specific correlation
>> coefficients (i.e. a dataset that returns r = 0.30, etc.) as examples
>> for a lab I am teaching this summer. Is there a way to do that in R?
>>
>> Thanks.
>>
>> Jim Milks
>>
>> Graduate Student
>> Environmental Sciences Ph.D. Program
>> 136 Biological Sciences
>> Wright State University
>> 3640 Colonel Glenn Hwy
>> Dayton, OH 45435
>>
>>
>>
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org

        [[alternative HTML version deleted]]



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. Received on Thu 14 Jun 2007 - 11:13:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 14 Jun 2007 - 12:31:57 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.