title: Comparing two linear models with anova() in R
body: <p>I don't quite understand what the p-value in this output means. I don't mean p-values as such, but in this case.</p>
  
  <pre><code>&gt; Model 1: sl ~ le + ky 
  &gt; Model 2: sl ~ le   
    Res.Df     RSS Df   Sum of Sq      F Pr(&gt;F) 
  1     97 0.51113                              
  2     98 0.51211 -1 -0.00097796 0.1856 0.6676
  </code></pre>
  
  <p>I get something like that, and now I am wondering which model is the better fit.
  As there is only ONE and not TWO p-values I'm getting confused.
  I get different pvalues using summary(model1) or summary(model2)</p>
  
  <p>Now if </p>
  
  <pre><code>&gt; fm2&lt;-lm(Y~X+T)
  </code></pre>
  
  <p>(T being my indicator variable) and </p>
  
  <pre><code>&gt; fm4&lt;-lm(Y~X)
  </code></pre>
  
  <p>if I do </p>
  
  <pre><code>&gt; anova(fm2,fm4)
  </code></pre>
  
  <p>this tests the null hypothesis <code>H0: alpha1==alpha2</code>
  <code>(Ha: alpha1!=alpha2)</code>c(alpha being my intercept)
  So it is tested whether it is better to have one intercept (=> <code>alpha1==alpha2</code>), or two intercepts (<code>alpha1!=alpha2</code>)</p>
  
  <p>In this case we would now obviously reject the null Hypotheses, as the p-value is 0.6676.</p>
  
  <p>This would mean we should rather stick with model <code>fm4</code>, as it is more appropriate for our data.</p>
  
  <p>Did I draw the conclusions right? I tried my very best, but I am not sure what the p-value means. As there is only on, this is what I thought it might mean.
  Can someone clear things up?</p>