Simulates independent variables.
Arguments
- n
the number of values to simulate.
- mu
the sample average.
- cor
correlation between bivariate normal
- var
the sample variance. The
sqrt(var)is passed tornorm()andrlnorm()for normal and laplace distributions.sqrt(var / 2)is used forlaplace().- method
must be one of
"uniform"(default),"normal", or"bivnormal"(bivariate normal).
Examples
make_x(10, mu = c(0.5, 1.2), var = c(1, 0.5))
#> x_1 x_2
#> 1 1.9959718 0.4221742
#> 2 0.7548479 1.6919259
#> 3 0.4359789 1.6539163
#> 4 3.2498562 2.3179395
#> 5 2.7756985 0.4806377
#> 6 2.6259748 2.3726676
#> 7 1.8448598 0.9481884
#> 8 1.8941873 1.5930107
#> 9 0.3322992 1.9953450
#> 10 1.3452830 0.1738275