Hey let's say that I want to predict fuel consumption of a car and I have some independent variables and one qualitative variable which is country in which car was produced (assume that in the data we have only three countries: Spain, Japan, USA). So to avoid "dummy trap" I should create 2 dummy variables (Spain and Japan) instead of three, am I right (or three dummies but without intercept)? But what if I want to predict fuel consumption of a car which is produced in Germany (this country isnt included in data which we use to create model). Whether the "dummy trap" also occurs in logit and probit regression or only in linear?
Answering your questions:
- Yes, that is correct. Including all three dummies in the model would result in perfect colinearity, and the statistical software would drop one of them for you. All dummy coefficients would therefore be in relation to the omitted dummy. You may not include all 3 dummies even without the intercept, as a dummy represents a change in the level of the fitted line. Without an intercept, your model is equivalent estimating the model as deviations from the mean, and including 3 dummies would implicate in the same perfect colinearity problem (violating OLS assumptions).
- If you don't have information about cars in Germany, you may not use this model to predict consumption of cars produced there. If you don't include any dummies you may extrapolate the model to Germany, but that wouldn't be credible as you have reason to believe that being made in Germany can affect independent variables (e.g: brand of the car, type of engine etc.) and is correlated with your outcome variable as well, causing a potential endogeneity issue. All you cans ay with the dummies you have is that, by omitting one of them, a car made in the country which the dummy is = 1 consumes $\beta$ extra liters than the baseline country (omitted dummy).
- Yes, it occurs in logit and probit as well. You won't have a full-rank X if your regressors are perfectly colinear, and therefore won't be able to invert it.