corgen {ecodist} | R Documentation |
Generate correlated data vectors of a given length.
corgen(len, r, population = FALSE, epsilon = 0)
len |
Length of data vectors. |
r |
Correlation between data vectors. |
population |
TRUE for vectors drawn from two populations with correlation r, otherwise r is the sample correlation. |
epsilon |
If epsilon = 0, it has no effect, otherwise the sampling process is repeated until the sample correlation is within epsilon of r. This option allows the production of exactly-correlated data, within the limits of epsilon. |
This function is more sophisticated that the corgen function available in the stats package.
If it is a LIST, use
x |
First data vector. |
y |
Second data vector. |
...
Sarah Goslee
~~objects to See Also as help
, ~~~
# create two random variables of length 100 with correlation # of 0.10 +/- 0.00001 corgen(100, .1, epsilon=0.00001)