【发布时间】:2011-06-22 03:57:58
【问题描述】:
我有一个指数模型计算
mod <- nls(y ~ exp(- (x/a)^b), data = DF, start = list(a = 200, b = 1.4))
我使用的绘图:
plot(x,y)
lines(sort(DF$x),predict(mod, list(x=sort(DF$x))), lwd=2, col="red")
写mod我明白了:
Nonlinear regression model
model: y ~ exp(-(x/a)^b)
data: DF
a b
211.7098 0.3908
residual sum-of-squares: 17.69
Number of iterations to convergence: 5
Achieved convergence tolerance: 1.477e-07
summary(mod) 我得到:
Formula: y ~ exp(-(x/a)^b)
Parameters:
Estimate Std. Error t value Pr(>|t|)
a 2.117e+02 2.799e+00 75.64 <2e-16 ***
b 3.908e-01 9.154e-03 42.69 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.08832 on 2268 degrees of freedom
Number of iterations to convergence: 5
Achieved convergence tolerance: 1.477e-07
(8 observations deleted due to missingness)
我的问题是,是否有办法将公式、参数和残差平方和添加到图中?我能想到的唯一方法是使用text() 并复制并粘贴我想要的信息,但我将不得不做很多不同的模型,所以我想要一些自动的东西。谢谢!
【问题讨论】: