我正在尝试使用se
绘制nls模型。使用se=T
似乎不是一种选择。尽管here和here对该主题进行了一些讨论,但总而言之,在使用ggplot2绘制nls时,我们需要关闭se绘图才能起作用。
所以,我的问题是如何绘制这些错误?
我的代码如下:
A <- c(2.14,0.90,6.40,2.50,10.60,1.14,8.30,3.10,6.00,1.60,7.00,1.17,5.60,2.14,0.90,
6.40,2.50,10.60,1.14,8.30,3.10,6.00,1.60,7.00,1.17,5.60,2.14,0.90, 6.40,2.50,
10.60,1.14,8.30,3.10,6.00,1.60,7.00,1.17,5.60,2.14,0.90,6.40,2.50,10.60,1.14,
8.30,3.10,6.00,1.60,7.00,1.17,5.60)
B <- c(195.53250,255.57243,137.67337,157.52710,83.03922,216.30603,61.87585,
193.58356,126.80942,213.12280,137.50060,285.78766,144.18174,204.82289, 266.42932,
137.83316,150.79204,85.08704,195.09191,68.09929,194.24539,119.96574, 201.18025,
137.50060,275.70720,144.20467,195.53250,266.42932,138.24046,157.52710,65.70746,
216.30603,99.74814,194.24539,126.80942,213.12280,137.50060,285.78766,110.04981,
204.82289,255.57243,130.25267,150.79204,83.24710,195.09191,68.09929,193.58356,
114.37214,213.12280,137.50060,275.70720,144.20467)
datii <- cbind(A,B)
datii <- as.data.frame(datii)
ggplot(datii, aes(x = A, y = B))+
geom_point()+
geom_smooth(color="black", formula=y~a*x^b, method="nls", se=F,
method.args = list(start=c(a=150,b=2)) )
这将生成带有点和nls模型的图形,但是我想绘制错误。
非常感谢您的帮助!