# How many variables can be included in one multiple regression model? [duplicate]

I was wondering if there is any limitation regarding the number of independent variables if I want to simultaneously include all variables in one regression model.

Not in principle, but there will be practical limits based on computing power, sample size and multiple testing issues.

• What happens when the number of independent variables exceeds the number of observations?
– whuber
Commented Mar 13, 2020 at 13:07
• Then you have a choice between infinitely many model instances that all fit the data perfectly. I suppose you could call that a principled limitation.
– Arne
Commented Mar 13, 2020 at 13:41
• Be a little cautious: having more variables than observations does not imply the regression will fit perfectly!
– whuber
Commented Mar 13, 2020 at 13:43
• Yes, not in general, I was thinking of linear regression only.
– Arne
Commented Mar 13, 2020 at 13:53
• Especially in linear regression, having more variables than observations is no guarantee of a perfect fit. As an example, suppose all the variables are multiples of each other. The point is that the proper measure of how many variables there are is not their count: it's the dimension of the vector space they span.
– whuber
Commented Mar 13, 2020 at 15:38