This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------ | |
rm(list = ls()) | |
set.seed(50) | |
# function for generating random draws from multivariate distribution | |
# n = number of draws; p = number of variables | |
# u = mean of each variable; s = SD of each variable | |
# corMat = correlation matrix | |
mvrnorm <- function(n, p, u, s, corMat) { |