I have a data set, for which I graphed a regression (using ggplot2
's stat_smooth
) :
ggplot(data = mydf, aes(x=time, y=pdm)) + geom_point() + stat_smooth(col="red")
I'd also like to have the quantiles (if it's simpler, having only the quartiles will do) using the same method. All I manage to get is the following :
ggplot(data = mydf, aes(x=time, y=pdm, z=surface)) + geom_point() + stat_smooth(col="red") + stat_quantile(quantiles = c(0.25,0.75))
Unfortunately, I can't put method="loess"
in stat_quantile()
, which, if I'm not mistaken, would solve my problem.
(In case it's not clear, desired behavior = non linear regressions for the quantiles, and therefore the regression for Q25 and Q75 being below and above (respectively) my red curve (and Q50, if plotted, would be my red curve)).
Thanks