if I use values (1,0) for a categorical column in X... does it lead to any ill conditioned matrices during OLS/ robust regression?.
3 Answers
No, it doesn't lead to ill-conditioning, unless the column of 0's and 1's representing your categorical (binary) covariate can be very well approximated by a linear combination of the other columns of X.
With the accuracy of modern computers, and accuracy of the algorithms we use in OLS, ill conditioning is very unlikely to affect your calculations, unless the column of 0's and 1's is exactly equivalent to some combination of the other columns. A simple example of this might be where you had two categorical covariates coded as 0/1, say one for sex and one for smoking. If all the smokers are men and vice versa, X is rank-deficient, i.e. very badly ill-conditioned. Happily, when this happens most OLS software will report some form of warning or error, so it's easy to spot in practice.
-
1$\begingroup$ +1 for emphasizing the point that the answer has to depend the relationship between the categorical covariate and all the other columns of the design matrix $X$. $\endgroup$– whuber ♦Feb 27, 2012 at 22:23
Suppose that you have a dummy variable for men and a dummy variable for women. If you include an intercept in your model, as is typical and generally good practice, the coefficients on the male dummy and the female dummy are not uniquely identified. Instead, you need to exclude one of those variables (i.e., just include the male dummy and not the female dummy). On interpretation, see this question.
Not by itself. In fact, this is done all the time. If the variable in the column is a dichotomy, then 0,1 makes it pretty straightforward to interpret results. If the variable can take 3 or more values, there are various coding schemes including dummy coding and effect coding.