title: Printing all glm coefficients in R
body: <p>How do I print glm coefficients for all factor levels, including reference level?
  summary(glm_obj) prints only the values that deviate from reference values.</p>
  
  <p>I know that those are 0's, but I need this for integration, i.e. telling other systems what factor levels can happen at all.</p>
  
  <p>Sorry if it's too simple, could not find anywhere.</p>
  
  <p>Thanks</p>
  
  <p>To illustrate the problem I am facing:</p>
  
  <pre><code>&gt; glm(Petal.Width~Species,data=iris)  
  
  Call:  glm(formula = Petal.Width ~ Species, data = iris)  
  
  Coefficients:
            (Intercept)  Speciesversicolor   Speciesvirginica  
                  0.246              1.080              1.780  
  
  Degrees of Freedom: 149 Total (i.e. Null);  147 Residual
  Null Deviance:      86.57 
  Residual Deviance: 6.157    AIC: -45.29`
  </code></pre>
  
  <p>The model description above yields only coefficients for versicolor and virginica, which is, as Dason has noted, absolutely fine from the point of view of the model itself. </p>
  
  <p>However, I needed to share the model with another application, which must know what levels of Species to expect (and e.g. issue a warning in once a new, unstudied level appears).</p>
  
  <p>Summary() gives the same results:</p>
  
  <pre><code>&gt; summary(glm(Petal.Width~Species,data=iris))
  
  Call:
  glm(formula = Petal.Width ~ Species, data = iris)
  
  Deviance Residuals: 
     Min      1Q  Median      3Q     Max  
  -0.626  -0.126  -0.026   0.154   0.474  
  
  Coefficients:
                    Estimate Std. Error t value Pr(&gt;|t|)    
  (Intercept)        0.24600    0.02894    8.50 1.96e-14 ***
  Speciesversicolor  1.08000    0.04093   26.39  &lt; 2e-16 ***
  Speciesvirginica   1.78000    0.04093   43.49  &lt; 2e-16 ***
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  
  (Dispersion parameter for gaussian family taken to be 0.04188163)
  
  Null deviance: 86.5699  on 149  degrees of freedom
  Residual deviance:  6.1566  on 147  degrees of freedom
  AIC: -45.285
  
  Number of Fisher Scoring iterations: 2
  </code></pre>