带线的二次回归模型

时间:2017-10-11 04:46:39

标签: r

我正在尝试制作我的情节的二次回归线,但在我的图表中,我发现太多的线条粘在一起。我想要一条线而不是太多。任何人都可以帮助我吗?

谢谢,我的代码如下     data1< - read.csv(" C:/ Users / Tej Prasad Acharya / Documents / NUE / NDVI and     SPAD.csv&#34)     附(DATA1)

withrow <- data1[which(data1$Rowcover == "Yes"),]
withoutrow <- data1[which(data1$Rowcover == "No"),]

withrow <- data1[which(data1$Rowcover == "Yes"),]
withoutrow <- data1[which(data1$Rowcover == "No"),]

plot(withrow$SPAD..60.DAT. ~ withrow$N.rate)
m2 <- lm(withrow$SPAD..60.DAT. ~ withrow$N.rate + I(withrow$N.rate^2))
lines(withrow$N.rate,predict(m2))

请看下面的图片。我只需要从每次治疗的中间点开始一行。

enter image description here

0 个答案:

没有答案