Steven Sanderson takes us through two regression techniques. First up is stepwise regression:
Stepwise regression is a powerful technique used to build predictive models by iteratively adding or removing variables based on statistical criteria. In R, this can be achieved using functions like
step()or manually with forward and backward selection.
Piecewise regression is a powerful technique that allows us to model distinct segments of a dataset with different linear relationships. It’s like fitting multiple straight lines to capture the nuances of different regions in your data. So, grab your virtual lab coat, and let’s get started.
Read on for explanations of both techniques, as well as some visuals and potential pitfalls you might run into along the way.