powered by
Given a target r-value, returns the correlation you need to induce in a bivariate normal distribution to have the target correlation after converting distributions.
convert_r( target_r = 0, dist1 = "norm", dist2 = "norm", params1 = list(), params2 = list(), tol = 0.01 )
r-value to induce in the bivariate normal variables
The target correlation
The target distribution function for variable 1 (e.g., norm, binom, gamma, truncnorm)
The target distribution function for variable 2
Arguments to pass to the functions for distribution 1
Arguments to pass to the functions for distribution 2
Tolerance for optimise function
See Distributions for distributions and their various arguments to specify in params1 and params2.
convert_r(target_r = 0.5, dist1 = "norm", dist2 = "binom", params1 = list(mean = 100, sd = 10), params2 = list(size = 1, prob = 0.5))
Run the code above in your browser using DataLab