Generate correlated data vectors of a given length.
Usage
corgen(len, r, population = FALSE, epsilon = 0)
Arguments
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.
Value
If it is a LIST, use
xFirst data vector.
ySecond data vector.
...
Details
This function is more sophisticated that the corgen function available in the stats package.