Description Usage Arguments Details
The variables x and y stem from a distribution with correlation rho, but the actual correlation between x and y will vary around that true value.
1 2 |
rho |
True correlation coefficient in the population. If rho_sub is given, this is the correlation in the rest of the sample without the subset. |
rho_sub |
True correlation coefficient in the subset. Default is no seperate subset. |
fraction |
The size of the subset as a percentage of the full sample. The subset is then contained in the first round(N * fraction) rows of the returned data frame. |
n |
Sample size. |
Code from http://stats.stackexchange.com/questions/15011/generate-a-random-variable-with-a-defined-correlation-to-an-existing-variable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.