[Rd] Buglet/omission in nls package (PR#6901)

berwin at maths.uwa.edu.au berwin at maths.uwa.edu.au
Fri May 21 08:41:38 CEST 2004


Dear all,

I noticed the following under R 1.8.1 (when nls was still a separate
package) but the same problem occurs under R 1.9.0 (where most (all?)
of nls is now in the stats package):

> data(Puromycin)
> fm <- nls(rate~SSmicmen(conc,b0,b1), Puromycin, subset = state=="treated")
> coef(summary(fm))
NULL

The problem seems to be that summary.nls uses the name "parameters"
instead of the name "coefficients" for the matrix with the estimates,
standard errors, t values and p values:

> summary(fm)$parameters
       Estimate  Std. Error   t value     Pr(>|t|)
b0 212.68370728 6.947153198 30.614512 3.241160e-11
b1   0.06412123 0.008280944  7.743227 1.565136e-05

Thus, coef.default fails on an object of class "summary.nls".

Possible fixes:
1) Rename that part of the summary.nls structure from parameters to
   coefficients  (not sure if that breaks something else); or
2) Write a coef.summary.nls method that returns the structure
   parameter from a summary.nls object passed to it.

Cheers,

        Berwin

--please do not edit the information below--

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = 
 major = 1
 minor = 9.0
 year = 2004
 month = 04
 day = 12
 language = R

Search Path:
 .GlobalEnv, package:methods, package:stats, package:graphics, package:utils, Autoloads, package:base



More information about the R-devel mailing list