Skip to content

Can I build an array of regrssion model?

1 message · Liaw, Andy

#
And if you *really* want piecewise linear function (and most likely you want
the pieces to be continuous, no?), there are better ways than yours.  For
"manual" fitting, use something like:

  library(splines)
  lm(y ~ bs(x, knots=..., deg=1))

For more automatic fitting, I believe bruto() or even mars() in the package
`mda' will do.

Andy
------------------------------------------------------------------------------