Skip to content
Prev 26414 / 398502 Next

Can I build an array of regrssion model?

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
------------------------------------------------------------------------------