# Why would R return NA as a lm() coefficient?

I am fitting an lm() model to a data set that includes indicators for the financial quarter (Q1, Q2, Q3, making Q4 a default). Using lm(Y~., data = data) I get a NA as the coefficient for Q3, and a warning that one variable was exclude because of singularities.

Do I need to add a Q4 column?

NA as a coefficient in a regression indicates that the variable in question is linearly related to the other variables. In your case, this means that $Q3 = a \times Q1 + b \times Q2 + c$ for some $a, b, c$. If this is the case, then there's no unique solution to the regression without dropping one of the variables. Adding $Q4$ is only going to make matters worse.
• (+1). NA more generally means that the coefficient is not estimable. This can happen due to exact collinearity, as you've mentioned. But, it can also happen due to not having enough observations to estimate the relevant parameters (e.g. if $p > n$). If you predictors are categorical and you're adding interaction terms, an NA can also mean that there are no observations with that combination of levels of the factors. – Macro Apr 4 '12 at 0:59
• $p > n$ is just a special case of colinearity - if there are fewer observations than predictors, colinearity is a given. You're right about interaction terms though, although I'm pretty sure that's not what's happening here. – Martin O'Leary Apr 4 '12 at 1:03