在nlsplot()中,如何在R中查看模型方程?

问题描述 投票:0回答:1

我生成了一个数据

nitrogen<- c(0,40,80,120,160,260)
yield <- c(8.4,9.8,10.8,12.5,11.1,12.7)
dataA<- data.frame(nitrogen, yield)

我想将此数据视为二次平台模型。所以我用了

nlsplot()
代码。

install.packages("easynls")
library(easynls)
nlsplot(dataA, model=4)

图中包含模型方程。我想看看关于这个二次平台模型的完整模型方程。

你能告诉我怎么做吗?

总是非常感谢!

r nls
1个回答
1
投票

一个解决方案是使用 par() 函数调整 par() 中的绘图大小和字体大小参数,然后运行 nlsplot():

# change the font size for the plot
par(cex.lab = 1.5, cex.axis = 1.5, cex=1.2)

# plot the data with formula
nlsplot(dataA, model = 4)

现在我将公式的字体大小更改为 0.8 以更好地覆盖。您可以使用 par() 参数来调整您的情节。

par(cex.lab = 1, cex.axis = 1, cex=0.8)

nlsplot(dataA, model = 4)

© www.soinside.com 2019 - 2024. All rights reserved.