title: R: how to extract information from summary model fit
body: <pre><code>library(nlme)
  fm1 &lt;- nlme(height ~ SSasymp(age, Asym, R0, lrc),
              data = Loblolly,
              fixed = Asym + R0 + lrc ~ 1,
              random = Asym ~ 1,
              start = c(Asym = 103, R0 = -8.5, lrc = -3.3))
  &gt; summary(fm1)
  Nonlinear mixed-effects model fit by maximum likelihood
    Model: height ~ SSasymp(age, Asym, R0, lrc) 
   Data: Loblolly 
         AIC      BIC    logLik
    239.4856 251.6397 -114.7428
  
  Random effects:
   Formula: Asym ~ 1 | Seed
              Asym  Residual
  StdDev: 3.650642 0.7188625
  
  Fixed effects: Asym + R0 + lrc ~ 1 
           Value Std.Error DF   t-value p-value
  Asym 101.44960 2.4616951 68  41.21128       0
  R0    -8.62733 0.3179505 68 -27.13420       0
  lrc   -3.23375 0.0342702 68 -94.36052       0
   Correlation: 
      Asym   R0    
  R0   0.704       
  lrc -0.908 -0.827
  
  Standardized Within-Group Residuals:
          Min          Q1         Med          Q3         Max 
  -2.23601930 -0.62380854  0.05917466  0.65727206  1.95794425 
  
  Number of Observations: 84
  Number of Groups: 14 
  </code></pre>
  
  <p>I'm interested in extracting information from the summary output of an NLME fit. </p>
  
  <p>I would like to extract the </p>
  
  <ol>
  <li>StdDev of the random effects (i.e. StdDev of Asym, which = 3.65) For this one I've tried <code>fm1$apVar</code> but no luck.</li>
  <li>Parameter estimates of the fixed effects (i.e. Asym = 101.44960, R0 = -8.62733, etc), which can be extracted via <code>fixef(fm1)</code></li>
  <li>Std.Error of the fixed effects (i.e. 2.46, 0.317, 0.034). For this one I've tried <code>sqrt(diag(fm1$varFix))</code> but those values don't exactly match the ones under Std.Error column under fixed effects?</li>
  <li>logLikelihood (i.e. -114.7428, which can be extracted using <code>fm1$logLik</code>)</li>
  <li>Residuals (i.e. 0.7188625, which can be extracted using <code>fm1$Residuals</code>)</li>
  </ol>
  
  <p>My ultimate goal is to fit multiple models and store their respective summary estimates into an organized <code>data.frame</code>.</p>
  
  <pre><code>fm1 &lt;- nlme(height ~ SSasymp(age, Asym, R0, lrc),
              data = Loblolly,
              fixed = Asym + R0 + lrc ~ 1,
              random = Asym ~ 1,
              start = c(Asym = 103, R0 = -8.5, lrc = -3.3))
  
  fm2 &lt;- nlme(height ~ SSasymp(age, Asym, R0, lrc),
              data = Loblolly,
              fixed = Asym + R0 + lrc ~ 1,
              random = Asym ~ 1,
              start = c(Asym = 103, R0 = -5.4, lrc = -3.3))
  
  summary(fm1)
  summary(fm2)
  
  mylist = list(NULL, summary(fm1), NULL, summary(fm2), NULL, NULL)
  </code></pre>
  
  <p>Suppose my list object looks like <code>mylist</code>. Now I would like to create a <code>data.frame</code> that looks like:</p>
  
  <pre><code>model    FixedAsym    FixedAsymStdError   FixedR0      ...     Residual
   1       101.44960        2.4616951       -8.62733            0.7188625
   2       101.44934        2.4616788       -8.62736     ...    0.7188625
  </code></pre>
  
  <p>And to create this data.frame (the number of rows corresponds to how many model summaries I have in <code>mylist</code>) I would need to systematically extract those values (numbered 1-5) from the model summary output. </p>