title: Creating a function in R, then regressing y on x
body: <p>I need to create a function in R defined as: y = a + bx +e. Values have been given as: a = 1, b = 2, and e is a random draw from a normal distribution (mean = 0, sd = 1). Based on this, I create a function using the function command:
  <code>function(a, bx, e)</code> </p>
  
  <p>and create 'a', 'b', and 'e' as variables:</p>
  
  <pre><code>a &lt;- 1
  
  b &lt;- 2
  
  e &lt;- rnorm(1, 0, 1)
  </code></pre>
  
  <p>I want to run the program so that it creates this function, but whenever I do, I get an error that it cannot find object 'x'. As I have these issues, I am unable to then run a regression of y on x.</p>