Simulate a single multivariate data set consisting of n subjects and d phenotypes for each

sim1(X, B, Sigma)

Arguments

X

design matrix (incorporating genotype probabilities from two loci), dn by df

B

a matrix of allele effects, f rows by d columns

Sigma

dn by dn covariance matrix

Value

a vector of length dn. The first n entries are for trait 1, the second n for trait 2, etc.

Examples

n_mouse <- 20 geno <- rbinom(n = n_mouse, size = 1, prob = 1 / 2) X <- gemma2::stagger_mats(geno, geno) B <- matrix(c(1, 2), ncol = 2, nrow = 1) sim1(X, B, Sigma = diag(2 * n_mouse))
#> [,1] #> [1,] 0.12863291 #> [2,] -0.45729772 #> [3,] 0.62772851 #> [4,] -0.19146280 #> [5,] 0.58708961 #> [6,] -0.11533387 #> [7,] 0.34681789 #> [8,] 0.72167655 #> [9,] -0.19136770 #> [10,] -0.54452703 #> [11,] -0.03527251 #> [12,] 1.04785759 #> [13,] -0.24038406 #> [14,] -0.73669918 #> [15,] -0.97348996 #> [16,] -0.50186833 #> [17,] 1.08659135 #> [18,] 2.14486935 #> [19,] 2.28297816 #> [20,] 1.11339509 #> [21,] 0.10040642 #> [22,] 3.47456298 #> [23,] 1.75776342 #> [24,] 2.61409513 #> [25,] 1.49274063 #> [26,] 1.19029818 #> [27,] 2.25928577 #> [28,] 2.62588272 #> [29,] -0.74465958 #> [30,] 1.83711640 #> [31,] 0.83662292 #> [32,] -0.61284798 #> [33,] 0.86238545 #> [34,] 1.65703622 #> [35,] -0.42119374 #> [36,] 2.59785938 #> [37,] -0.53900500 #> [38,] 2.98459760 #> [39,] 1.45445926 #> [40,] 1.07715988