Skip to main content
1 of 3
Tim
  • 141.2k
  • 26
  • 270
  • 512

The second coding brings absolutely no information, since ismale is perfectly correlated to isfemale and always if first is true, then the second must be false. So introducing the second variable does nothing. In general, to encode $k$ categories, you need $k-1$ dummy variables, since if each of the $k-1$ dummies it false, then $k$'th "default" category must be true (assuming that your data represents something like single-choice questions, so the categories are exclusive and exactly one needs to be true).

See also related threads
Why is gender typically coded 0/1 rather than 1/2, for example?
Why 0 for failure and 1 for success in a Bernoulli distribution?

Tim
  • 141.2k
  • 26
  • 270
  • 512