Skip to content

Instantly share code, notes, and snippets.

@JimGrange
JimGrange / effect_sizes.R
Last active November 25, 2021 15:48
Low power = inaccurate effect size estimates
#------------------------------------------------------------------------------
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) {