title: simulating a simple linear model
body: <p>I'm trying to simulate a simple linear model 100 times and find the LS estimation of B1 from the linear model.</p>
  <pre><code>set.seed(123498)
  x&lt;-rnorm(z, 0, 1)
  e&lt;-rnorm(z, 0 ,2)
  y&lt;-0.5 + 2*x + e
  model&lt;- lm(y~x)
  simulaten=100
  z=10
  
  for (i in 1:simulaten){
    e&lt;-rnorm(n, 0 ,2)
    x&lt;-rnorm(n, 0, 1)
    y&lt;-0.5 + 2*x + e
    model&lt;- lm(y~x)}
    summary(model)
  </code></pre>
  <p>Is that what my for loop is achieving or have i missed the mark?</p>