rsim | R Documentation |
Simulates vectors of scores with specified correlation, means, and standard deviations.
rsim(n, rho, x, meanx = 0, sdx = 1, meany = 0, sdy = 1, to.data.frame = FALSE)
n |
number of observations. If |
rho |
correlation in the population. |
x |
vector of scores to be correlated with. If |
meanx , sdx |
the desired mean and standard deviation of x. |
meany , sdy |
the desired mean and standard deviation of y. |
to.data.frame |
should the results be converted to a |
When to.data.frame
is TRUE
, returns a data frame of
scores on x and y. Otherwise, a list containing:
x
when supplied, or the simulated vector of scores
the vector y sampled from a population correlating with
x
at rho
the supplied correlation rho
the estimated correlation between x and y
the means and standard deviations of x and y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.