Simulate normal distributed real data (phenotypes) from genotypic data in R I am trying to understand how the process of simulation works. I come from the biology, so many of this concepts are new to me. 
In the firs place, I am going to define what I have available and what I need to do: 


*

*I have genomic information (molecular markers - SNPs) of a set of individuals, this information is a set of variables that take values of 0, 1 and 2. It can be seen for example as: 


v_1 = cbind(rep(rbinom(10,2,0.4)),rep(rbinom(10,2,0.4)),rep(rbinom(10,2,0.4)),rep(rbinom(10,2,0.4)), rep(rbinom(10,2,0.4)))

      [,1] [,2] [,3] [,4] [,5]
 [1,]    1    0    1    1    0
 [2,]    1    1    1    0    0
 [3,]    2    0    0    0    1
 [4,]    1    0    0    1    1
 [5,]    1    1    1    0    1
 [6,]    1    2    1    1    0
 [7,]    1    0    1    2    2
 [8,]    1    1    1    2    2
 [9,]    1    1    1    1    2
[10,]    0    1    1    1    0

This example can be seen as the genotypic information for 10 individuals and 5 molecular markers (SNPs). In my real data I have around 1000 individuals and 1000 SNPs.


*

*I want to use all my genotypic information as random variable in a mixed model context to simulate new observed data (phenotype of the individuals). The simulated data must be normally distributed (mean=0 and varaince=1) and should be only dependent of a genotypic information.

*The state of the SNPs (0, 1 or 2) should be associated to an effect in the phenotype (the sum of all the SNPs would be the total phenotype).
I am trying to program this in R. Could someone give an idea of how to do deal with this problem?  
I can provide more information to define better the problem.
I already asked a similar question here
https://stackoverflow.com/questions/61538840/simulate-normal-distributed-data-from-genetic-data-in-r?noredirect=1#comment108871412_61538840
 A: You can assume the genotypes to be like:
set.seed(111)
# number of individuals
n = 1000
# number of SNPs
snps = 2000
# you can specify it otherwise
p = rep(0.4,snps)
#gives you more flexibility 
v_1 = sapply(p,rbinom,n=n,size=2)

It is going to be hard to end with a phenotype that is normally distributed and has effect due to your genotype. If there's a fair amount of effect and fair amount of individuals with those effects, then there will be a heavy tail. Below is a quick try but I think a lot of thinking needs to go into simulating the effect.
Making some assumptions, 1. the background noise (i.e errors) to be $\backsim N(0,1)$ and 2. in a simplistic model, 1% of the SNPs have a small effect $\backsim N(0,0.2)$.
BG = rnorm(nrow(v_1))
effects = rep(0,ncol(v_1))
#specify the ones with effects, 1% 
hits = sample(1:length(effects),length(effects)/100)
effects[hits] = rnorm(length(hits),0,sqrt(0.2))

phenotype = BG + v_1 %*% effects

We plot the distribution, and in blue is the theoretical normal distribution, you can see the heavy tails:
hist(phenotype,br=50,freq=FALSE,ylim=c(0,0.4))
lines(h$mids,dnorm(h$mids),col="blue")


There will be situations where the distribution might shift, due to the effect of snps and how these will be distribution in the genotype. You can always scale your phenotype again to get a standard normal.
