simcor | R Documentation |
Simulate pairs of variables with a predefined correlation between them.
simcor(obs = 100, rhos = c(-0.5, 0.5))
obs |
A single integer that determines the number of simulated observations in each of the pair of variables. |
rhos |
A vector with at least one value that shows the theoretical correlation between the simulated pair of variables. |
a list with as many data.frames (each consisting of two columns) as there are values passed to the function argument 'rhos'.
Marcel Miché
pdf, see headline: Simulating data with known correlations
# Simulate a list with two data.frames. The first one contains variables that are correlated
# around -.8, the second one around .7. Both data.frames contain 200 observations.
simcor(obs = 200, rhos = c(-.8, .7))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.