\begin{Schunk}
\begin{Sinput}
 Nsampsize <- 500
 x <- rnorm(Nsampsize, m=50, sd=10)
 meanx <- mean(x)
 minx <- min(x)
 simr <- function(i){
  e <- rnorm(Nsampsize, m=0, s=1)
  yhet <- b0 + b1 * x + mult*(x-minx)*stde*e
  mod <- lm(yhet ~ x)
  mod
  }
 nsims <- 1000
 reshet <- lapply(1:nsims, simr)
\end{Sinput}
\end{Schunk}
