Dear WizaRds, A run of nls produces the following concise summary:> summary(cs.wt)Formula: 0 ~ wt.MM(conc, time, A1, a1, A2, a2) Parameters: Estimate Std. Error t value Pr(>|t|) A1 4.814e+02 2.240e+01 21.495 0.0296 * a1 7.401e-01 7.435e-02 9.956 0.0637 . A2 1.613e+02 1.738e+01 9.280 0.0683 . a2 1.770e-02 7.324e-03 2.417 0.2497 ------------------------------------------ I need to access the estimates of A1,a1,A2... How can I do this? Also, I need to add a column to Parameters: giving the ratio of the Std. Error to Estimate. Is there a way to get summary to do this? I can't find the summary implementation. I am using R 1.7.0 on Windows XP HELP! Please:-) Kind Regards, Oscar A. Linares The Geriatrics Center, University of Michigan
DivineSAAM at aol.com wrote:> Dear WizaRds, > > A run of nls produces the following concise summary: > > >>summary(cs.wt) > > > Formula: 0 ~ wt.MM(conc, time, A1, a1, A2, a2) > > Parameters: > Estimate Std. Error t value Pr(>|t|) > A1 4.814e+02 2.240e+01 21.495 0.0296 * > a1 7.401e-01 7.435e-02 9.956 0.0637 . > A2 1.613e+02 1.738e+01 9.280 0.0683 . > a2 1.770e-02 7.324e-03 2.417 0.2497 > > ------------------------------------------ > I need to access the estimates of A1,a1,A2... > > How can I do this? > > Also, I need to add a column to Parameters: giving > the ratio of the Std. Error to Estimate. Is there a way to get summary to do this? > I can't find the summary implementation. > > I am using R 1.7.0 on Windows XP >Most of the time, you can assign the summary list to a variable and extract it that way. As in (using the example on ?nls): R> x = summary( fm1DNase1 ) R> names(x) [1] "formula" "residuals" "sigma" [4] "df" "cov.unscaled" "correlation" [7] "parameters" R> x$parameters Estimate Std. Error t value Pr(>|t|) Asym 2.345180 0.07815395 30.00719 2.165503e-13 xmid 1.483090 0.08135322 18.23026 1.218535e-10 scal 1.041455 0.03227080 32.27236 8.506916e-14 sundar
DivineSAAM at aol.com writes:> Dear WizaRds, > > A run of nls produces the following concise summary: > > > summary(cs.wt) > > Formula: 0 ~ wt.MM(conc, time, A1, a1, A2, a2) > > Parameters: > Estimate Std. Error t value Pr(>|t|) > A1 4.814e+02 2.240e+01 21.495 0.0296 * > a1 7.401e-01 7.435e-02 9.956 0.0637 . > A2 1.613e+02 1.738e+01 9.280 0.0683 . > a2 1.770e-02 7.324e-03 2.417 0.2497 > > ------------------------------------------ > I need to access the estimates of A1,a1,A2... > > How can I do this?Use the coef extractor function, as in coef(cs.wt) In general the best way to get information on a fitted model is to use the extractor function like coef(object) as opposed to trying to decide which component in the object holds the information of interest. In the case of objects of the nls class you really do want to use the extractor functions because these objects have an unusual internal structure.> Also, I need to add a column to Parameters: giving > the ratio of the Std. Error to Estimate. Is there a way to get summary to do this?The "t value" is the ratio "Estimate"/"Std. Error". Do you really want "Std. Error"/Estimate?> I can't find the summary implementation.The nls package now has a namespace so the S3 methods are hidden. You need to use getS3method("summary", "nls") to see the gory details. -- Douglas Bates bates at stat.wisc.edu Statistics Department 608/262-2598 University of Wisconsin - Madison http://www.stat.wisc.edu/~bates/