title: Finding Mean Squared Error?
body: <p>I have produced a linear data set and have used <code>lm()</code> to fit a model to that dataset. I am now trying to find the MSE using <code>mse()</code></p>
  
  <p>I know the formula for MSE but I'm trying to use this function. What would be the proper way to do so? I have looked at the documentation, but I'm either dumb or it's just worded for people who actually know what they're doing.</p>
  
  <pre><code>library(hydroGOF)
  
  x.linear &lt;- seq(0, 200, by=1) # x data
  error.linear &lt;- rnorm(n=length(x.linear), mean=0, sd=1) # Error (0, 1)
  y.linear &lt;- x.linear + error.linear  # y data
  
  training.data &lt;- data.frame(x.linear, y.linear)
  training.model &lt;- lm(training.data)
  training.mse &lt;- mse(training.model, training.data)
  
  plot(training.data)
  </code></pre>
  
  <p><code>mse()</code> needs two data frames. I'm not sure how to get a data frame out of <code>lm()</code>. Am I even on the right track to finding a proper MSE for my data?</p>