title: How to get coefficients from a model in R?
body: <p>I am trying to store coefficients from a mle model just like a normally do for other models. Surprisingly, it throws an error. Any other methods to store it?</p>
  <pre><code>set.seed(111)
  y.size &lt;- rnorm(100,4,1)
  p &lt;- rnorm(100,5,1)
  
  df &lt;- data.frame(p, y.size)
  
  glae &lt;- function(A,K,Ka,q, sigma, c) {
    lnqp &lt;- if(q == 0) log(p) else ((p^q - 1)) / q
    y.pred &lt;- ((A *((p*K/Ka)-1))-1)* lnqp + c
    ll &lt;-   -sum(dnorm(y.size, mean = y.pred, sd = sigma, log=TRUE ))
    ll
  }
  
  mle2.model &lt;- mle(glae, start = list(A = -2, K = 100, Ka = 200, q= 0.1, sigma = 0.1, c=3.8))
  summary(mle2.model)
  
  Maximum likelihood estimation
  
  Call:
  </code></pre>
  <p>mle(minuslogl = glae, start = list(A = -2, K = 100, Ka = 200,
  q = 0.1, sigma = 0.1, c = 3.8))</p>
  <pre><code>Coefficients:
          Estimate Std. Error
  A      12.511258        NaN
  K      99.537509        NaN
  Ka    200.231236 1684.30918
  q     -32.959393        NaN
  sigma 363.906677        NaN
  c       8.135369   35.47982
  
  -2 log L: 1363.185 
  
  
  A.final &lt;- summary(mle2.model)$Coefficients[1]
  
  `Error in summary(mle2.model)$Coefficients : $ operator not defined for this S4 class
  </code></pre>
  <p>In addition: Warning message: In sqrt(diag(object@vcov)) : NaNs produced`</p>