I am working on some data that has a discontinuity at the 0.5 mark of the independent variable on my x-axis. To show this, I have applied a regression line above and below the 0.5 threshold:
clip(0,0.49999,0,100)
abline(lm(score ~ demvoteshare, data = subset(Lee, demvoteshare <= 0.5)), col="red")
clip(0.5,1,0,100)
abline(lm(score ~ demvoteshare, data = subset(Lee, demvoteshare > 0.5)), col="green")
I want to add a LOWESS line as well, and have managed that for the entire scatter plot:
lines(lowess(Lee$demvoteshare, Lee$score, f = 2/3, delta = 0.01*1), col="red")
Is it possible to make this split in two, as with the regression lines? Or would that be against the purpose of the LOWESS line?
(Sorry for not having any reproducible data, and I do not know how to upload data sets here)