I have some data which I've undertaken a 7 order polynomial regression on using r; the plot resembles a bell curve.
I need to find the two steepest parts of the curve. So far I have managed to find and show the steepest ascending slope, now I need the steepest descending slope.
Here is what I have so far:
attach(DATA1)
names(DATA1)
"dist" "ohms"
plot(dist,ohms)
reg<-lm(ohms~poly(dist,7))
summary(reg)
lines(smooth.spline(dist,predict(reg)))
xv<-seq(min(dist),max(dist),0.02)
yv<-predict(reg,list(dist=xv))
lines(xv,yv,lwd=2)
plot(xv,yv,type="l")
xv[which(abs(diff(yv))==max(abs(diff(yv))))]
abline(v=xv[which(abs(diff(yv))==max(abs(diff(yv))))])
Does anybody know how to find the steepest descending part of the slope?
Thanks