However this uses a single value (knots=20) for the breakpoint in each facet. I would like to pass a unique value for each facet (that I have calculated earlier). Is this possible?
I tried adding a variable to the data frame and passing the variable name (e..g, psi) as an aesthetic, but geom_smooth wouldn't recognize it. I suspect the answer has something to do with defining a custom function as described at the end of this page: Smoothed conditional means — geom_smooth • ggplot2
Thanks so much for this package - it is amazing and I love using it.
Thanks for your response but it seems to miss the problem which is to provide a custom knot to each facet for the (broken) line of best fit. As far as I can tell your code just overlays a linear fit on the predictions from custom piecewise models. Maybe I missed something...?
However this uses a single value (knots=20) for the breakpoint in each facet. I would like to pass a unique value for each facet (that I have calculated earlier). Is this possible?
My example shows how to have 18 knot param for one facet, 19 for another, and 20 for the third.