0

I am trying to make quadratic regression line of my plot but, in my graph, I found too many line sticked together. I want a single line and not too many. Can anyone help me?

Thanks, my code is as follows data1 <- read.csv("C:/Users/Tej Prasad Acharya/Documents/NUE/NDVI and SPAD.csv") attach(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))

please see the below picture. I only need one line that goes from the middle of the point of each treatment.

enter image description here

Juan
  • 2,156
  • 18
  • 26

0 Answers0