Hi all, I need to use the parameter estimates of nls() for further analysis. I know how to do in S+, e.g. nls(...)$parameters. In R, the attributes(nls(...)) does not have parameters, how would one get the parameter values out of nls()? Thanks in advance. Nancy
Peter Dalgaard
2003-Nov-24 21:57 UTC
[R] How to get the parameters of nls(...) for later use
"Nancy Lo" <Nancy.Lo at noaa.gov> writes:> Hi all, > > I need to use the parameter estimates of nls() for further analysis. I > know how to do in S+, e.g. nls(...)$parameters. In R, the > attributes(nls(...)) does not have parameters, how would one get the > parameter values out of nls()? > Thanks in advance.Same way as you really ought to do it in S-PLUS: library(nls) example(nls) coef(Pur.wt) or, if you insist on using the internals: Pur.wt$m$getPars() -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Douglas Bates
2003-Nov-24 22:06 UTC
[R] How to get the parameters of nls(...) for later use
"Nancy Lo" <Nancy.Lo at noaa.gov> writes:> I need to use the parameter estimates of nls() for further analysis. I > know how to do in S+, e.g. nls(...)$parameters. In R, the > attributes(nls(...)) does not have parameters, how would one get the > parameter values out of nls()?In both R and S-PLUS the use of the extractor function coef() is the preferred way to obtain the parameter estimates from a fitted nls model. Try coef(nls(...))