Skip to content
Prev 43018 / 398506 Next

Combining several regressions

Hadley Wickham <h.wickham at auckland.ac.nz> writes:
[Untested!]

b <- by(data.frame, conditioning.variable, 
        function(subset) { loess(y ~ x, subset) })

unsplit(lapply(b,fitted), conditioning.variable)

You might need to replace the by() by an

  lapply(split(data.frame,cond.var), FUN)

construction, but it doesn't look like it should be necessary.