lindeloev / tests-as-linear

Common statistical tests are linear models (or: how to teach stats)
https://lindeloev.github.io/tests-as-linear/
487 stars 92 forks source link

Usually, we use a symmetric matrix for the `Sigma` parameter of `MASS::mvrnorm` function. #30

Open danli349 opened 1 year ago

danli349 commented 1 year ago

Usually, we use a symmetric matrix for the Sigma parameter of MASS::mvrnorm function.

# Fixed correlation
D_correlation = data.frame(MASS::mvrnorm(30, mu = c(0.9, 0.9), 
Sigma = matrix(c(1, 0.8, 1, 0.8), ncol = 2), empirical = TRUE))  # Correlated data

I think it should be Sigma = matrix(c(1, 0.8, 0.8, 0.8), ncol = 2)