title: Why do geom_smooth nls and the standalone nls give different fit results?
body: <p>When I fit my data using geom_smooth nls, I get a really nice fit. But if I use the stand alone nls function to fit my data using the same equation and starting values, I get a much poorer fit.  I want to extract fit parameters so really need the standalone nls to generate the same fit as the geom_smooth nls.</p>
  <p>Any suggestion/hint at what might be going on?</p>
  <pre><code>
  df &lt;- data.frame(&quot;x&quot; = c(4.63794469, 1.54525711, 0.51508570, 0.17169523, 0.05737664, 5.11623138, 1.70461130, 0.56820377, 0.18940126, 0.06329358, 0.02109786), 
                   &quot;y&quot; = c(0.1460101, 0.7081954, 0.9619413, 1.0192286, 1.0188301, 0.3114495, 0.7602488, 0.8205661, 0.9741323, 1.0922553, 1.1130464))
  
  fit &lt;- nls(data = df, y ~ (1/(1 + exp(-b*x + c))), start = list(b=1, c=0))
  df$stand_alone_fit &lt;- predict(fit, df)
  
  df %&gt;% ggplot() +
    geom_point(aes(x = x, y = y)) +
    scale_x_log10() +
    ylim(0,1.2) +
    geom_smooth(aes(x = x, y = y), method = &quot;nls&quot;, se = FALSE, 
                method.args = list(formula = y ~ (1/(1 + exp(-b*x + c))), start = list(b= 1, c=0))) +
    geom_line(aes(x = x, y = stand_alone_fit), color = &quot;red&quot;) +
    labs(title = &quot;Blue: geom_smooth nls fit\nRed: stand alone nls fit&quot;)
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/eERyH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eERyH.png" alt="enter image description here" /></a></p>