This functions is a modified version of the code
available at the nls2 package on github
https://github.com/ggrothendieck/nls2. This function is no
longer available in the current version of nls2 package.
as.lm(object, ...) # S3 method for nls as.lm(object, ...)
| object | An object of class |
|---|---|
| ... | Currently not used. |
This function returns an object of class lm created
from the nls object. The linear model design matrix used
is the the partial derivatives of the nls model function
with relation to the model parameters, i.e. the gradient matrix.
This function is useful to get the residuals plot for the
fitted nls model. The dependence on the as.proto.list
function in the proto package was removed (also this
function no longer exists). Thanks for the original author of
this function G. Grothendieck.
# An simple nls fit. n0 <- nls(dist ~ A + B * speed^C, data = cars, start = c(A = 0, B = 1, C = 1)) summary(n0)#> #> Formula: dist ~ A + B * speed^C #> #> Parameters: #> Estimate Std. Error t value Pr(>|t|) #> A 5.4878 10.6846 0.514 0.60992 #> B 0.2612 0.4847 0.539 0.59248 #> C 1.7875 0.5553 3.219 0.00233 ** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Residual standard error: 15.19 on 47 degrees of freedom #> #> Number of iterations to convergence: 7 #> Achieved convergence tolerance: 3.481e-06 #>#> Error in fitted(n0): object 'n0' not foundlayout(1)