Get variance of noise to add to Z in order to yield proxies X with desired correlations with Z
getNoiseVar.RdGet variance of noise to add to Z in order to yield proxies X with desired correlations with Z
Value
A vector of variances of independent Gaussian random variables to add to Z in order to yield proxies with the desired correlations with Z.
Examples
# Noise variance needed so a proxy Z + N(0, v) attains each target
# correlation with Z (correlations must be positive).
getNoiseVar(c(0.9, 0.5, 1))
#> [1] 0.2345679 3.0000000 0.0000000