Skip to main content
added 68 characters in body
Source Link
dlnB
  • 2.3k
  • 8
  • 18

If I had to bet, I wouldHaving more 11 regressors is not a problem unless you have fewer than 11 observations. My guess is that you are including all dummy variables on the right-hand side, leading to a singular matrix error. This is referred to as the 'dummy variable trap'. The problem is that you need to leave out one category in a set of dummy variables that exhaust all possible categories.

For example, if the two possible values of gender are male and female, you cannot include a dummy of each on the right-hand side. Similarly, if you had a dummy for each state in panel data, you could only include 49 dummies. The reason is that if you do not exclude one dummy (used as the 'reference' category), then columns of $X$ which correspond to the exhaustive set of dummies are not linearly independent, meaning $(X'X)$ is not invertible and therefore $\hat{\beta}=(X'X)^{-1}(X'Y)$ cannot be calculated.

Also, please make sure you are not taking logs of categorical variables.

If I had to bet, I would guess that you are including all dummy variables on the right-hand side, leading to a singular matrix error. This is referred to as the 'dummy variable trap'. The problem is that you need to leave out one category in a set of dummy variables that exhaust all possible categories.

For example, if the two possible values of gender are male and female, you cannot include a dummy of each on the right-hand side. Similarly, if you had a dummy for each state in panel data, you could only include 49 dummies. The reason is that if you do not exclude one dummy (used as the 'reference' category), then columns of $X$ which correspond to the exhaustive set of dummies are not linearly independent, meaning $(X'X)$ is not invertible and therefore $\hat{\beta}=(X'X)^{-1}(X'Y)$ cannot be calculated.

Also, please make sure you are not taking logs of categorical variables.

Having more 11 regressors is not a problem unless you have fewer than 11 observations. My guess is that you are including all dummy variables on the right-hand side, leading to a singular matrix error. This is referred to as the 'dummy variable trap'. The problem is that you need to leave out one category in a set of dummy variables that exhaust all possible categories.

For example, if the two possible values of gender are male and female, you cannot include a dummy of each on the right-hand side. Similarly, if you had a dummy for each state in panel data, you could only include 49 dummies. The reason is that if you do not exclude one dummy (used as the 'reference' category), then columns of $X$ which correspond to the exhaustive set of dummies are not linearly independent, meaning $(X'X)$ is not invertible and therefore $\hat{\beta}=(X'X)^{-1}(X'Y)$ cannot be calculated.

Also, please make sure you are not taking logs of categorical variables.

Source Link
dlnB
  • 2.3k
  • 8
  • 18

If I had to bet, I would guess that you are including all dummy variables on the right-hand side, leading to a singular matrix error. This is referred to as the 'dummy variable trap'. The problem is that you need to leave out one category in a set of dummy variables that exhaust all possible categories.

For example, if the two possible values of gender are male and female, you cannot include a dummy of each on the right-hand side. Similarly, if you had a dummy for each state in panel data, you could only include 49 dummies. The reason is that if you do not exclude one dummy (used as the 'reference' category), then columns of $X$ which correspond to the exhaustive set of dummies are not linearly independent, meaning $(X'X)$ is not invertible and therefore $\hat{\beta}=(X'X)^{-1}(X'Y)$ cannot be calculated.

Also, please make sure you are not taking logs of categorical variables.