title: Error in eval(predvars, data, env) when doing Bootstrapping
body: <p>I am trying to fit a linear regression mode to examine the impact of COVID on traffic volume. Here is my dataset that have 31 observations which I have normalised using min-max scaling.</p>
  <pre><code>structure(list(Date = c(&quot;Jul-19&quot;, &quot;Aug-19&quot;, &quot;Sep-19&quot;, &quot;Oct-19&quot;, 
  &quot;Nov-19&quot;, &quot;Dec-19&quot;, &quot;Jan-20&quot;, &quot;Feb-20&quot;, &quot;Mar-20&quot;, &quot;Apr-20&quot;, &quot;May-20&quot;, 
  &quot;Jun-20&quot;, &quot;Jul-20&quot;, &quot;Aug-20&quot;, &quot;Sep-20&quot;, &quot;Oct-20&quot;, &quot;Nov-20&quot;, &quot;Dec-20&quot;, 
  &quot;Jan-21&quot;, &quot;Feb-21&quot;, &quot;Mar-21&quot;, &quot;Apr-21&quot;, &quot;May-21&quot;, &quot;Jun-21&quot;, &quot;Jul-21&quot;, 
  &quot;Aug-21&quot;, &quot;Sep-21&quot;, &quot;Oct-21&quot;, &quot;Nov-21&quot;, &quot;Dec-21&quot;, &quot;Jan-22&quot;), 
      Average.Weekday.Daily.Traffic..Veh.day. = c(0.888327194565519, 
      0.957155270369628, 0.895880165623604, 0.942066917846049, 
      1, 0.877361842545003, 0.703731456172012, 0.898082382615854, 
      0.607783746512863, 0, 0.317277553217312, 0.560830088053501, 
      0.706464878860476, 0.747561202987416, 0.737478848514911, 
      0.800118905645907, 0.857496156674019, 0.809655982748128, 
      0.708357519023144, 0.926517717996616, 0.895669090512526, 
      0.856018630896471, 0.925733222167108, 0.825782121234508, 
      0.798338838875814, 0.533903939716948, 0.819263418220707, 
      0.84537340946109, 0.792752384269276, 0.64987564158039, 0.365423786054267
      ), Case = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0.00543532109442455, 
      0.00036093929142663, 5.66179280669224e-05, 0, 0.000134467579158941, 
      0.000339707568401534, 0.000127390338150575, 0.000113235856133845, 
      0, 0.000169853784200767, 0.000106158615125479, 0.00106158615125479, 
      0.0015286840578069, 0, 0, 0.00110404959730499, 0.00312814052569746, 
      0, 0.000268935158317881, 0, 0.00153576129881527, 1), Regulation = c(0, 
      0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0.666666666666667, 0.333333333333333, 
      0.333333333333333, 0.166666666666667, 0.166666666666667, 
      0.166666666666667, 0.166666666666667, 0.333333333333333, 
      0.166666666666667, 0.333333333333333, 0.166666666666667, 
      0.166666666666667, 0.333333333333333, 0.166666666666667, 
      0.166666666666667, 0.166666666666667, 0.166666666666667, 
      0, 0, 0)), row.names = c(NA, -31L), class = &quot;data.frame&quot;)
  </code></pre>
  <p>My model and output:</p>
  <pre><code>m1 &lt;- lm(Average.Weekday.Daily.Traffic..Veh.day. ~ Case + Regulation, data = data)
  summary(m1)
  
  Call:
  lm(formula = Average.Weekday.Daily.Traffic..Veh.day. ~ Case + 
      Regulation, data = data)
  
  Residuals:
       Min       1Q   Median       3Q      Max 
  -0.35325 -0.00991  0.00712  0.05537  0.25166 
  
  Coefficients:
              Estimate Std. Error t value Pr(&gt;|t|)    
  (Intercept)  0.89096    0.03061  29.104  &lt; 2e-16 ***
  Case        -0.52838    0.13368  -3.952 0.000477 ***
  Regulation  -0.53484    0.08077  -6.622 3.49e-07 ***
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  
  Residual standard error: 0.1301 on 28 degrees of freedom
  Multiple R-squared:  0.6548,    Adjusted R-squared:  0.6301 
  F-statistic: 26.55 on 2 and 28 DF,  p-value: 3.413e-07
  </code></pre>
  <p>Although the independent variables are significant but I found that errors are not normally distributed using Jarque-Bera test. I tried to fix it by doing Bootstrapping with the following codes:</p>
  <pre><code>set.seed(4321)
  m2 &lt;- Boot(m1, R = 100, method = &quot;residual&quot;)
  summary(m2)
  </code></pre>
  <p>But I received an error message even though I have included Case variable in my linear model: <code>Error in eval(predvars, data, env) : object 'Case' not found</code></p>
  <p>Could anyone please help explain for me why is it giving this error and how to fix it? Thank you so much for your help.</p>