1

My main goal is making predictions using a nonlinear model that have many independent variables.

I would like to split my numerical independent variables into ranges/parts. Then to use a combination of these ranges to predict a dependent variable. Suppose I split each variable A, B and C into 4 ranges. I will have 4^3 combinations. Is there any type of regression that do the optimal splitting and give results for each combination ?

Pedro Serra
  • 111
  • 1
  • Why do you want to split? – user2974951 Feb 15 '19 at 10:52
  • Suposse I have a numerical independent variable that goes from 100 to 200. I want to do like 100-125 -> 1 . 125-150->2 . 150-175->3 . 175-200->4 . In this way I can use the numbers as factors and the combine with other factors. Thanks. – Pedro Serra Feb 15 '19 at 11:14
  • Have a look at https://stats.stackexchange.com/questions/68834/what-is-the-benefit-of-breaking-up-a-continuous-predictor-variable for why that is a bad idea. – user2974951 Feb 15 '19 at 11:45

1 Answers1

1

The R segmented package might offer what you are looking for: https://cran.r-project.org/web/packages/segmented/segmented.pdf

"Given a regression model, segmented `updates' the model by adding one or more segmented (i.e., piece-wise linear) relationships. Several variables with multiple breakpoints are allowed."

Jonathan Moore
  • 251
  • 1
  • 7