Chapter 6 Exploriatory Data Analysis: Two or more variables
In the last two chapters, we saw how to work with a single variable by creating graphs and examining descriptive statistics. This chapter supports PDS Video 7, which shows how to explore relationships using two variables graphs. We will look at how to create two types of graphs: bar plots and scatter plots. The appropriate graph depends on the type of data you have. The table explains which graph to use based on the data you have.
| Dependent (Response) Variable | ||
|---|---|---|
| Independent (Explanatory) Variable | Categorical | Quantitative |
| Categorical | Bar Graph (C -> C) | Bar Graph (C -> Q) |
| Quantitative | Bar Graph (Q -> C) | Scatterplot (Q -> Q) |
Depending on the type of data you have, you may need to also use your data management skills in creating these graphs. The only instance where you won’t have to do data management is if you are graphing two quantitative variables and creating a scatterplot using the States or Gapminder data.
If your dataset is from the World Values Survey, you will focus on bar graphs. If you have States or Gapminder data, you will likely want to create scatterplots, and you may also want to create bar graphs.
I have included a graph decision-making flow chart at the end of the chapter. For making the graphs discussed, you have some firm decisions to make and some judgment calls. Here are the questions you need to ask yourself for each graph:
- Do I have two quantitative variables? If yes, you will be making a scatterplot. If no, you will be creating bar graphs.
If you don’t have two quantitative variables, ask yourself:
- Do I need to data manage my dependent variable? You will have these possibilities.
- My categorical dependent variable has two categories and is coded in a way that will allow the reader to interpret the graph easily. No data management is needed.
- My categorical dependent variable has two categories but isn’t coded in a way that makes interpretation easy. Manage the variable for clear interpretation.
- My categorical dependent variable has more than two categories. Manage it to get to two categories.
- I have a quantitative dependent variable. You can use it as is. No need to recode.
- My categorical dependent variable has two categories and is coded in a way that will allow the reader to interpret the graph easily. No data management is needed.
- Do I need to manage my independent variable? Ask yourself these questions:
- If you have a categorical independent variable: are the current categories the best way to understand my data? You may want to recode the variable for fewer categories.
- If you have a quantitative independent variable: how many categories best represent your data? Recode to create the appropriate categories.
- If you have a categorical independent variable: are the current categories the best way to understand my data? You may want to recode the variable for fewer categories.
In the next section, we will examine some examples.
