0
$\begingroup$

if I use values (1,0) for a categorical column in X... does it lead to any ill conditioned matrices during OLS/ robust regression?.

$\endgroup$
1
  • 1
    $\begingroup$ Where you might recall having ill conditioned matrices is if you put time {1,2,3,.....,} in as an explanatory variable. {1,0} dummies are OK though. $\endgroup$
    – joint_p
    Feb 27, 2012 at 12:11

3 Answers 3

2
$\begingroup$

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.

$\endgroup$
1
  • 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
2
$\begingroup$

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.

$\endgroup$
1
$\begingroup$

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.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.