Multiple Imputation for Missing Data: Indicator Variables versus Categorical Variables

A data set can contain indicator (dummy) variables, categorical variables and/or both. Initially, it all depends upon how the data is coded as to which variable type it is.

For example, a categorical variable like marital status could be coded in the data set as a single variable with 5 values:

1 Never Married

2 Currently Married

3 Separated

4 Divorced

5 Widowed

Or it could be coded as a set of four indicator variables:

Married: 1=Yes/0=No

Separated: 1=Yes/0=No

Divorced: 1=Yes/0=No

Widowed: 1=Yes/0=No

The fifth category, Never Married, doesn’t need it’s own variable because we have already indicated that category with a set of 0s on all four indicator variables.

Turning categorical variables into indicator variables and vice versa can be done using any statistical software package.  In our workshops we show how to write the code to do this in Stata, SPSS, and R.

Many researchers prefer using indicator variables directly when running their analysis. They are easy to view and understand the results in a regression analysis.

In many statistical procedures it doesn’t matter if you use a categorical variable or a series of indicator variables because as soon as you specify a variable as categorical, the software does the conversion to a set of indicator variables.

But not all procedures do this for you. Let’s look at an example.

Survey data is notorious for having missing data.

Many analytical models only use complete cases (listwise deletion) in the analysis. Complete case analysis on survey data can lead to biased results.

If the observations are missing at random (MAR), a well thought out, properly run multiple imputation model can impute values for the missing data. As a result, your analysis will contain a larger sample size and greater statistical power and be unbiased.

There are many steps involved in creating a well thought out multiple imputation model. One step requires determining if there is any missing data within the indicator variables.

If there is, the first step is to determine if the indicator is a subset of a larger group.  For example, the indicator variable “married” may be one of a series of indicator variables for marital status.  If there are no other indicators of marital status you can leave it as is.

If there are two or more subset indicators for a categorical group and any one of them has missing data  you must combine them into a categorical variable before running a multiple imputation model.

Why is this important?

If you have subgroup indicators of marital status it is possible that an observation could have a 1 for Single, 0 for the Divorced and missing for Married. When you run the multiple imputation model it is possible to end up with an imputed value of 1 for the missing data in the Married variable.  The observation would now have a “1” for Single and a “1” for Married. We know this would be inaccurate.

If you do create a new categorical variable, there are two things you must be cautious of. First, make sure you are adding all of the sub groups into your new categorical variable.  Second, be sure you write your code correctly to account for the missing data.

One of the important takeaways is the importance of understanding the structure of the missing data in a data set before running a multiple imputation model. Not understanding the nuances of the missingness will lead to poor imputation and inaccurate results.

Jeff Meyer is a statistical consultant with The Analysis Factor, a stats mentor for Statistically Speaking membership, and a workshop instructor. Read more about Jeff here.

 

Approaches to Missing Data: the Good, the Bad, and the Unthinkable
Learn the different methods for dealing with missing data and how they work in different missing data situations.

Reader Interactions


Leave a Reply

Your email address will not be published. Required fields are marked *

Please note that, due to the large number of comments submitted, any questions on problems related to a personal study/project will not be answered. We suggest joining Statistically Speaking, where you have access to a private forum and more resources 24/7.