Description Usage Arguments Details
The correlation between x and y will be exactly rho. If only fraction is given but not rho_sub, rho_sub will be set to rho.
1 2 | getBiCop_exact(N, rho, rho_sub = NA, mu1 = 0, sd1 = 1, fraction = NA,
distribution = "norm_norm")
|
N |
Sample size |
rho |
True correlation coefficient in the sample if rho_sub is not given, otherwise rho is the correlation in the rest of the sample that does not belong to the subset |
rho_sub |
Correlation in the subset |
mu1 |
Mean of variable x (on log scale if type = "log_norm") |
sd1 |
Standard deviation of variable x (on log scale if type = "log_norm") |
fraction |
Fraction of the returned data.frame that belongs to the subset. The subset consists of the first round(N * fraction) rows |
type |
The distributions of the two variables (columns). If "norm_norm" both are normally distributed, if "log_log" both are lognormally distributed, if type = "log_norm" x will be lognormally distributed and y standard normal. |
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.