title: Different NA actions for coefficients and summary of linear model in R
body: <p>In R, when using <code>lm()</code>, if I set <code>na.action = na.pass</code> inside the call to <code>lm()</code>, then in the summary table there is an NA for any coefficient that cannot be estimated (because of missing cells in this case). </p>
  
  <p>If, however, I extract just the coefficients from the summary object, using either <code>summary(myModel)$coefficients</code> or <code>coef(summary(myModel))</code>, then the NA's are omitted.</p>
  
  <p>I want the NA's to be included when I extract the coefficients the same way that they are included when I print the summary. Is there a way to do this?</p>
  
  <p>Setting <code>options(na.action = na.pass)</code> does not seem to help.</p>
  
  <p>Here is an example:</p>
  
  <pre><code>&gt; set.seed(534)
  &gt; myGroup1 &lt;- factor(c("a","a","a","a","b","b"))
  &gt; myGroup2 &lt;- factor(c("first","second","first","second","first","first"))
  &gt; myDepVar &lt;- rnorm(6, 0, 1)
  &gt; myModel &lt;- lm(myDepVar ~ myGroup1 + myGroup2 + myGroup1:myGroup2)
  &gt; summary(myModel)
  
  Call:
  lm(formula = myDepVar ~ myGroup1 + myGroup2 + myGroup1:myGroup2)
  
  Residuals:
         1        2        3        4        5        6 
  -0.05813  0.55323  0.05813 -0.55323 -0.12192  0.12192 
  
  Coefficients: (1 not defined because of singularities)
                      Estimate Std. Error t value Pr(&gt;|t|)
  (Intercept)         -0.15150    0.23249  -0.652    0.561
  myGroup11            0.03927    0.23249   0.169    0.877
  myGroup21           -0.37273    0.23249  -1.603    0.207
  myGroup11:myGroup21       NA         NA      NA       NA
  
  Residual standard error: 0.465 on 3 degrees of freedom
  Multiple R-squared: 0.5605,     Adjusted R-squared: 0.2675 
  F-statistic: 1.913 on 2 and 3 DF,  p-value: 0.2914 
  
  &gt; coef(summary(myModel))
                 Estimate Std. Error    t value  Pr(&gt;|t|)
  (Intercept) -0.15149826  0.2324894 -0.6516352 0.5611052
  myGroup11    0.03926774  0.2324894  0.1689012 0.8766203
  myGroup21   -0.37273117  0.2324894 -1.6032180 0.2072173
  
  &gt; summary(myModel)$coefficients
                 Estimate Std. Error    t value  Pr(&gt;|t|)
  (Intercept) -0.15149826  0.2324894 -0.6516352 0.5611052
  myGroup11    0.03926774  0.2324894  0.1689012 0.8766203
  myGroup21   -0.37273117  0.2324894 -1.6032180 0.2072173
  </code></pre>