Dummy variables are used to represent qualitative or categorical variables that take on only two values, usually 0 and 1. A dummy variable indicates the presence or absence of a particular attribute. For example, a dummy variable could represent gender where 1 = male and 0 = female. Dummy variables allow qualitative variables to be used in regression models. However, there is a "dummy variable trap" where including dummy variables for all categories of a qualitative variable leads to perfect multicollinearity. To avoid this, only n-1 dummy variables should be included where there are n categories.