Problems displaying LOESS regression line and confidence interval
I am having some issues trying to compete a LOESS regression with a data set. I have been able to properly create the line, but I am unable to get it to plot correctly. I ran through the data like this. animals.lo <- loess(X15p5 ~ Period, animals, weights = n.15p5) animals.lo summary(animals.lo) plot(X15p5~ Period, animals) lines(animals$X15p5, animals.lo, col="red") At this point I received an error "Error in xy.coords(x, y) : 'x' and 'y' lengths differ" I searched around and read that this issue could be due to the points needing to be ordered, so I proceeded. a <- order(animals$Period)