title: contrasts in anova
body: <p>I understand the contrasts from previous posts and I think I am doing the right thing but it is not giving me what I would expect.</p>
  
  <pre><code>x &lt;- c(11.80856, 11.89269, 11.42944, 12.03155, 10.40744,
         12.48229, 12.1188, 11.76914, 0, 0,
         13.65773, 13.83269, 13.2401, 14.54421, 13.40312)
  type &lt;- factor(c(rep("g",5),rep("i",5),rep("t",5)))
  type
   [1] g g g g g i i i i i t t t t t
  Levels: g i t
  </code></pre>
  
  <p>When I run this:</p>
  
  <pre><code>&gt; summary.lm(aov(x ~ type))
  
  Call:
  aov(formula = x ~ type)
  
  Residuals:
      Min      1Q  Median      3Q     Max 
  -7.2740 -0.4140  0.0971  0.6631  5.2082 
  
  Coefficients:
              Estimate Std. Error t value Pr(&gt;|t|)    
  (Intercept)   11.514      1.729   6.659 2.33e-05 ***
  typei         -4.240      2.445  -1.734    0.109    
  typet          2.222      2.445   0.909    0.381    
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
  
  Residual standard error: 3.866 on 12 degrees of freedom
  Multiple R-squared: 0.3753,     Adjusted R-squared: 0.2712 
  F-statistic: 3.605 on 2 and 12 DF,  p-value: 0.05943 
  </code></pre>
  
  <p>Here my reference is my type "g", so my <code>typei</code> is the difference between type "g" and type "i", and my <code>typet</code> is the difference between type "g" and type "t".</p>
  
  <p>I wanted to see two more contrasts here, the difference between <code>typei+typeg</code>  and type "t" and difference between type "i" and type "t" </p>
  
  <p>so the contrasts</p>
  
  <pre><code>&gt; contrasts(type) &lt;- cbind( c(-1,-1,2),c(0,-1,1))
  &gt; summary.lm(aov(x~type))
  
  Call:
  aov(formula = x ~ type)
  
  Residuals:
      Min      1Q  Median      3Q     Max 
  -7.2740 -0.4140  0.0971  0.6631  5.2082 
  
  Coefficients:
              Estimate Std. Error t value Pr(&gt;|t|)    
  (Intercept)  10.8412     0.9983  10.860 1.46e-07 ***
  type1        -0.6728     1.4118  -0.477    0.642    
  type2         4.2399     2.4453   1.734    0.109    
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
  
  Residual standard error: 3.866 on 12 degrees of freedom
  Multiple R-squared: 0.3753,     Adjusted R-squared: 0.2712 
  F-statistic: 3.605 on 2 and 12 DF,  p-value: 0.05943 
  </code></pre>
  
  <p>When I try to do the second contrast by changing my reference I get different results. I am not understanding what is wrong with my contrast.</p>