Hello, i need to simulate 100 times, n=40 , the distribution has 90% from X~N(0,1) + 10% from X~N(20,10) Is my loop below correct? Thank you
n=40 for(i in 1:100){ x<-rnorm(40,0,1) # 90% of n z<-rnorm(40,20,10) # 10% of n } x+z ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.