-1

I am attempting to construct a Linear Model based on a large number of explanatory variables (including interaction terms between variables) two of which are factor variables. Using a factor variable in either regsubsets() or leaps() causes an error. Is there another function or package I can use that will incorporate factor variables when attempting exhaustive model selection?

Thank You

James

merv
  • 67,214
  • 13
  • 180
  • 245

1 Answers1

1

I've had the same issue when setting up the leaps() or regsubsets() using the x and y matrices.

However, regsubsets(y~x1cont+factor(x2)..., data=data) works for me. No error. Perhaps that may work for you?

Ryan
  • 26,884
  • 9
  • 56
  • 83
Moose
  • 26
  • 1