Hi! I would like to post the following question:
I was trying to figure out how to do the simulation shown in Fig 10.6 of John Verzani's book 'Using R for Intro Statistics'. It is on page 290, with a description on the previous page. It seems like a simple thing... Just needing to duplicate a procedure. (Perhaps I need to do it with a loop?) This is what I was trying: replicate(100, { abline(lm(y~x)) plot(y~x) y=rnorm(100,x,5) x=rep(1:10,10) } Obviously not correct. Can anyone help me with a simple way to do this? With thanks, Manning [[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.