Re: [R] Generating uniformly distributed correlated data.

2011-02-22 Thread Erich Neuwirth
You do not need the regions with the double densities near the center (1/2,1/2), you can use just the parallel 45 degree borders in that region also. x-x |/*\\\| |---/***\\| |--/*\| |-/**/|

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Erich Neuwirth
hw-function(r){ (3-sqrt(1+8*r))/4 } x-runif(1000) y-(x+runif(1000,-hw(0.5),hw(0.5))) %% 1 x and y will have correlation 0.5 and will be uniformly distributed on the unit interval. Replacing 0.5 by any nonnegative number r between 0 and 1 will create correlated uniformly distributed

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Mike Marchywka
Date: Mon, 21 Feb 2011 13:03:53 +0100 From: erich.neuwi...@univie.ac.at To: soren.fau...@biology.au.dk; r-help@r-project.org Subject: Re: [R] Generating uniformly distributed correlated data. hw-function(r){ (3-sqrt(1+8*r))/4 } x-runif

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Erich Neuwirth
We want to generate a distribution on the unit square with the following properties * It is concentrated on a reasonable subset of the square, and the restricted distribution is uniform on this subset. * Both marginal distributions are uniform on the unit interval. * All horizontal and all

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Mike Marchywka
Date: Mon, 21 Feb 2011 15:53:26 +0100 From: erich.neuwi...@univie.ac.at To: marchy...@hotmail.com CC: soren.fau...@biology.au.dk; r-help@r-project.org Subject: Re: [R] Generating uniformly distributed correlated data. We want to generate

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Kjetil Halvorsen
uniformly distributed correlated data. We want to generate a distribution on the unit square with the following properties * It is concentrated on a reasonable subset of the square, and the restricted distribution is uniform on this subset. * Both marginal distributions are uniform on the unit

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread David Winsemius
On Feb 21, 2011, at 9:53 AM, Erich Neuwirth wrote: We want to generate a distribution on the unit square with the following properties * It is concentrated on a reasonable subset of the square, and the restricted distribution is uniform on this subset. * Both marginal distributions are

[R] Generating uniformly distributed correlated data.

2011-02-21 Thread Larry Hotchkiss
, 20 Feb 2011 12:36:43 +0100 From: Enrico Schumannenricoschum...@yahoo.de To: =?iso-8859-1?Q?'S=C3=B8ren_Faurby'?= soren.fau...@biology.au.dk Cc:r-help@r-project.org Subject: Re: [R] Generating uniformly distributed correlated data. Message-ID:7C892818271C43E08DCFD8277CBD01CB@EnricosPC

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Ted Harding
-project.org] Im Auftrag von S??ren Faurby Gesendet: Sonntag, 20. Februar 2011 03:18 An:r-help@r-project.org Betreff: [R] Generating uniformly distributed correlated data. I wish to generate a vector of uniformly distributed data with a defined correlation to another vector The only

Re: [R] Generating uniformly distributed correlated data.

2011-02-21 Thread Ted Harding
@r-project.org Betreff: [R] Generating uniformly distributed correlated data. I wish to generate a vector of uniformly distributed data with a defined correlation to another vector The only function I have been able to find doing something similar is corgen from the library

Re: [R] Generating uniformly distributed correlated data.

2011-02-20 Thread Spencer Graves
You may also be interested in the psych package or possibly mvtBinaryEP. I found these using sos: library(sos) tc - findFn('tetrachoric correlation') # 26 matches tcs - findFn('tetrachoric correlations')#27 matches tc. - tc|tcs summary(tc.) # 35 links in 5 pkgs tc. All but 3 of

Re: [R] Generating uniformly distributed correlated data.

2011-02-20 Thread Enrico Schumann
-project.org Betreff: [R] Generating uniformly distributed correlated data. I wish to generate a vector of uniformly distributed data with a defined correlation to another vector The only function I have been able to find doing something similar is corgen from the library ecodist

Re: [R] Generating uniformly distributed correlated data.

2011-02-20 Thread Sarah Goslee
On Sun, Feb 20, 2011 at 12:18 AM, Peter Langfelder peter.langfel...@gmail.com wrote: On Sat, Feb 19, 2011 at 6:17 PM, Søren Faurby soren.fau...@biology.au.dk wrote: I wish to generate a vector of uniformly distributed data with a defined correlation to another vector The only function I

Re: [R] Generating uniformly distributed correlated data.

2011-02-20 Thread Søren Faurby
Thanks to everybody for helpfull answers. In case other people want to generate similar data at one time The one function I have found without any apparant bias ( such as extreme clustering of the datapoints along one or both diagonals in plot(x,y) or a slight bias in the generated

[R] Generating uniformly distributed correlated data.

2011-02-19 Thread Søren Faurby
I wish to generate a vector of uniformly distributed data with a defined correlation to another vector The only function I have been able to find doing something similar is corgen from the library ecodist. The following code generates data with the desired correlation to the vector x but

Re: [R] Generating uniformly distributed correlated data.

2011-02-19 Thread David Winsemius
On Feb 19, 2011, at 9:17 PM, Søren Faurby wrote: I wish to generate a vector of uniformly distributed data with a defined correlation to another vector The only function I have been able to find doing something similar is corgen from the library ecodist. The following code generates

Re: [R] Generating uniformly distributed correlated data.

2011-02-19 Thread Peter Langfelder
On Sat, Feb 19, 2011 at 6:17 PM, Søren Faurby soren.fau...@biology.au.dk wrote: I wish to generate a vector of uniformly distributed data with a defined correlation to another vector The only function I have been able to find doing something similar is corgen from the library ecodist. The

Re: [R] Generating uniformly distributed correlated data.

2011-02-19 Thread Jorge Ivan Velez
Hi Soren, Take a look at http://tolstoy.newcastle.edu.au/R/help/05/07/7741.html HTH, Jorge On Sat, Feb 19, 2011 at 9:17 PM, Søren Faurby wrote: I wish to generate a vector of uniformly distributed data with a defined correlation to another vector The only function I have been able to