title: Why do I get different results when using library(MASS) vs. MASS::?
body: <p>I noticed that I get different results when using <code>MASS::glm.nb</code> as opposed to <code>library(MASS)</code> and then <code>glm.nb</code>. I thought that <code>package::function()</code> would be a good way to avoid namespace conflicts (functions with the same name in different packages used in the same script) and that the results would be equivalent to <code>library(package)</code> and <code>function</code>. </p>
  
  <p>Can anybody explain me why these options lead to different results? Is this a particular issue to do with MASS or can we expect similar behaviour in other packages?</p>
  
  <pre class="lang-r prettyprint-override"><code>fm_nb_1 &lt;- MASS::glm.nb(mpg ~ cyl+hp, data = mtcars)
  
  library(MASS)
  fm_nb_2 &lt;- glm.nb(mpg ~ cyl+hp, data = mtcars)
  
  identical(fm_nb_1,fm_nb_2)
  [1] FALSE
  </code></pre>
  
  <p>Also, the first version cannot be printed with stargazer, while the second version can.</p>
  
  <pre class="lang-r prettyprint-override"><code>stargazer::stargazer(
    fm_nb_1
    , type = "text"
  )
  </code></pre>
  
  <p>This gives: <code>% Error: Unrecognized object type.</code></p>
  
  <p>However, this gives a nice output:</p>
  
  <pre class="lang-r prettyprint-override"><code>stargazer::stargazer(
    fm_nb_2
    , type = "text"
  )
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>==============================================
                        Dependent variable:     
                    ----------------------------
                                mpg             
  ----------------------------------------------
  cyl                         -0.102**          
                              (0.043)           
  
  hp                           -0.001           
                              (0.001)           
  
  Constant                    3.790***          
                              (0.146)           
  
  ----------------------------------------------
  Observations                   32             
  Log Likelihood              -84.287           
  theta             894,228.600 (23,863,364.000)
  Akaike Inf. Crit.           174.574           
  ==============================================
  Note:              *p&lt;0.1; **p&lt;0.05; ***p&lt;0.01
  </code></pre>