Skip to content

How can I extract information from list which class is nls

8 messages · Schatzi, Joshua Wiley, Peter Ehlers +2 more

#
How do I extract the standard error of the parameter estimates?

Also, if I would like to add two parameters together (x+y), can I use this
equation to calculate the new standard error?:
x = parameter 1
y = parameter 2
xSE = SE parameter 1
ySE = SE parameter 2

NewSE=(x+y)*sqrt((xSE/x)^2+(ySE/y)^2)



--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-extract-information-from-list-which-class-is-nls-tp804151p3476154.html
Sent from the R help mailing list archive at Nabble.com.
#
Hi,

One way would be:

summary(nls.object)[["coefficients"]][, "Std. Error"]

If you have a hankering to do it yourself rather than go through the
summary formula, the code here will get you there:
getAnywhere("summary.nls")

If you are going to be doing it a lot, creating a little function might be nice:

se.coef.nls <- function(model) {
  summary(model)[["coeffficients"]][, "Std. Error"]
}

se.coef.nls(yourmodel)

I have been doing something along those lines for a number of models.
Sadly, there is not a consistent name always given to the parameter or
coefficients table, so it will not quite be one size fits all, but
generally using str(), you can figure out what the names of what you
want are so it is not much trouble to get out.

str(summary(yourmodel))

Cheers,

Josh
On Tue, Apr 26, 2011 at 11:21 AM, Schatzi <adele_thompson at cargill.com> wrote:

  
    
#
On 2011-04-26 15:11, Joshua Wiley wrote:
I would generally use the coef() extractor function if
it's available (and it is for nls()). ?nls has an example:

   coef(summary(fm1DNase1))

which is a matrix from which you can get the SEs:

   coef(summary(fm1DNase1))[,"Std. Error"]

or

   coef(summary(fm1DNase1))[, 2]

Schatzi,
As to your other question about 'adding two parameters', that
doesn't make sense to me. Can you provide a sensible example?
In any case you would no doubt have to look at the covariance
matrix of the parameter estimates (with vcov()).

Peter Ehlers
#
I knew about coef() on model objects, but I did not know it had
methods for their summaries.  What wonderful information!

Josh
#
On Tue, Apr 26, 2011 at 2:21 PM, Schatzi <adele_thompson at cargill.com> wrote:
Try taking the square roots of their variance:
Asym       xmid       scal
0.07815395 0.08135321 0.03227080
Asym       xmid       scal
0.07815395 0.08135321 0.03227080
#
On Apr 27, 2011, at 9:28 AM, Schatzi wrote:

            
You should look at the vignettes and examples in the `fda` package.  
fda == Functional Data Analysis and the authors have a book that adds  
further background.

http://ego.psych.mcgill.ca/misc/fda/ex-growth-a2.html

You might also try:
RSiteSearch("growth curve")