ggpmisc icon indicating copy to clipboard operation
ggpmisc copied to clipboard

Support linear splines in `stat_poly_eq()` and other enhancements

Open aphalo opened this issue 4 months ago • 1 comments

Automatically generating eq.label for linear splines seems too complex to be worthwhile the effort, at least at the moment. However, a few changes to stat_poly_eq() would be very useful, as for example, currently the position of knots is not returned. Most important (and easier) is to support 'segmented'. No changes are needed in stat_poly_line().

Linear splines

  • [x] Avoid generation of bad equation labels when functions from package 'lspline' are used. Return NA instead.
  • [x] Avoid generation of bad equation labels when functions from package 'segmented' are used. Return NA instead.
  • [x] Return numeric values for parameter estimates when output.type = "numeric" but no eq.label is generated.
  • [x] Return the position of knots fitted by segmented(), estimates and their s.d..

All methods

  • [x] Return the names of the parameters as retrieved from fm.
  • [ ] ~~For polynomial/linear model fits return s.d. for estimates of model parameters as b_i.se in addition to b_i when output.type = "numeric", or as a vector (what would be better??).~~ Not really easy to show in an equation.

Other tasks

  • [x] Update the help for stat_poly_eq().
  • [x] Update article.
  • [ ] Add off-line tests to avoid dependency on these packages.

aphalo avatar Aug 23 '25 09:08 aphalo