Hi,
I'm trying to do a double for loop like this:
for (k in 1:1000){
for (i in 1:200){
y[i]<-rbinom(1,1,0.8)
x1[i]<-ifelse(y[i]==1,rnorm(1,mean=20, sd=2),rnorm(1,mean=16, sd=2.2))
....
}
for (j in 1:300){
....
}
}
Does anyone know a good reference about double loops?
Thank you,
Sigalit

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to