# Creating clustered bar charts for frequencies

## Video: Creating clustered bar charts for frequencies

Up to this point, we've covered methods for looking at one variable at a time as well as methods for looking at the associations between pairs of variables. In each case and consistent with good analytical practices, we started with charts because data is usually much easier to understand visually. Then we've done numerical descriptions of the variables and associations, and finally, we've done inferential statistics to generalize beyond the given data. In these last few sections, we'll take that pattern one more step by looking at methods for exploring the relationships of three or more variables, first with graphs and then with numbers.

## Creating clustered bar charts for frequencies

Up to this point, we've covered methods for looking at one variable at a time as well as methods for looking at the associations between pairs of variables. In each case and consistent with good analytical practices, we started with charts because data is usually much easier to understand visually. Then we've done numerical descriptions of the variables and associations, and finally, we've done inferential statistics to generalize beyond the given data. In these last few sections, we'll take that pattern one more step by looking at methods for exploring the relationships of three or more variables, first with graphs and then with numbers.

A quick word about terminologies in order, when you look at one variable at a time it's called a univariate analysis. When you look at the associations between pairs of variables, it's called a bivariate analysis. Therefore it would make sense that when you're looking at multiple variables, it would be called a multivariate analysis. However, that term multivariate is typically reserved for situations where you specifically have more than one outcome variable. Those kinds of statistics are much, much more complicated than what we're going to be doing, which is using more than one predictor variable with a single outcome variable.

So I will generally avoid the term multivariate and instead just talk about multiple variables. With that in mind, let's look at our first chart for multiple variables. And just like when we did charts for one variable or pairs of variables, we'll begin with bar chart for categorical variables. Just this time, we'll have three categorical variables. To demonstrate this, I'll use the General Social Survey dataset in GSS.sav. What we need to do is begin by going up to Graphs in the menu bar and we come to Chart Builder.

Then we come down to Bar, except instead of Simple, we're going to use Clustered this time. So I drag the Clustered bar chart up to the canvas. What we're going to look at as an outcome variable in this particular example is a person's self-rated happiness. Sometimes the easiest way to look at your outcome variable is to make it so that the colors of the bars go there. So I'm going to take self-rated happiness and I'm going to drag it over to Cluster on X set color. Then we need a categorical variable on the X-axis.

I thought it would be interesting to see whether a person had attended a live drama in the last year. I'll put that on the X-axis. So that's two categorical variables for using attendants at a live drama to predict self-rated happiness, but that's just two variables. We need a third one and to do that, we have to come down to this tab that says Groups and Point ID. I click on that, then I come down to either adding a Rows panel variable or a Columns panel variable. And all that influences is whether the charts show up one above the other or one next to the other.

In order to keep it compact, I'm going to do a Rows panel variable. Then I need to add one more variable that creates pairs of charts. And I'm going to use gender. I'm just going to come right up here to this one that says Male and drag that over here. And so you see what I'll end up with is four groups of three bars. Now I just come down to OK and I can make the chart. There is a lot of code that goes into that, and we can save that for future reference.

And then what we have here is bar charts. On the left, we have whether people attended a live drama in the last year. More people have not. It's about 3:1. And then on the right are people who say they have attended one. The top two are for women. The bottom two are for men. The blue bars are not too happy, the green bars are pretty happy, and the beige bars are very happy. We do have one small problem with this chart and that is that a lot smaller number of people have seen a live drama in the last year.

That's because we're charting counts here. A really handy feature in SPSS is the ability to chart percentages as well. So I'm going to show you how to go back and do that. I'm going to come back up to our most recent command, to Graphs, to Chart Builder, and then here in the elements property, I have Statistics and it says Count. That's how many people are in each category. I'm going to click on that and instead I'm going to go to Percentage and that has a question mark because I have to set a parameter over here. I find the most helpful one as each X-axis category.

So what this'll do, it'll make things add up to 100% for those who have and for those who have not seen drama. So I select that. I click Continue. I have to come down here and press Apply and then I come over here and press OK. And what you'll see now is that the chart will look slightly different. The biggest difference is that the bars on the right side, for those who have seen live drama in the last year, are much larger than they were before because using percentages has equalized the two groups and it makes it much easier to see the pattern.

For instance, we see that those who attended the live drama last year, interestingly, for men, those who have seen the live drama, the percentage who are very happy is smaller than the percentage of those who were pretty happy. On the other hand, for women, the percentage of people who were very happy is slightly higher than the percentage of people who were pretty happy for those who have seen a drama in the last year. On the other hand, for those who have not seen a drama, the patterns are nearly identical for men and for women. Where most people are pretty happy, the next group is very happy, and the least common is not too happy.

A clustered bar chart could be a handy way to depict the relationships of these three categorical variables. However, you'll probably want to chart percentages instead of counts, but your choice of denominator can make a big difference on how the final chart looks. This gets back to a point that data analysis is probably best thought of as a form of storytelling and you want to choose displays that help you tell your story well or that help the data tell you something interesting and unexpected. It's worth noting that if your outcome variable is a dichotomous indicator variable, that's a 0/1, yes/no variable, then you can sometimes make things easier by charting the mean of the outcome which for 0/1 indicator variable will be the proportion of people who got 1s, for example, the proportion who are returning customers as opposed to first-time customers.

And this leads us to the next chart we'll cover, the clustered bar chart for means.

Show transcript

#### This video is part of

SPSS Statistics Essential Training (2011)

52 video lessons · 19303 viewers

Author

Expand all | Collapse all
1. ### Introduction

2m 58s
1. Welcome
1m 5s
2. Using the exercise files
40s
3. Using a different version of the software
1m 13s
2. ### 1. Getting Started

19m 0s
1. Taking a first look at the interface
11m 49s
7m 11s
3. ### 2. Charts for One Variable

21m 54s
1. Creating bar charts for categorical variables
7m 18s
2. Creating pie charts for categorical variables
2m 54s
3. Creating histograms for quantitative variables
5m 45s
4. Creating box plots for quantitative variables
5m 57s
4. ### 3. Modifying Data

33m 10s
1. Recoding variables
5m 33s
2. Recoding with visual binning
5m 33s
3. Recoding by ranking cases
5m 26s
4. Computing new variables
5m 37s
5. Combining or excluding outliers
5m 21s
6. Transforming outliers
5m 40s
5. ### 4. Working with the Data File

28m 12s
1. Selecting cases
6m 44s
2. Using the Split File command
5m 12s
3. Merging files
5m 33s
4. Using the Multiple Response command
10m 43s
6. ### 5. Descriptive Statistics for One Variable

22m 14s
1. Calculating frequencies
8m 43s
2. Calculating descriptives
5m 31s
3. Using the Explore command
8m 0s
7. ### 6. Inferential Statistics for One Variable

16m 3s
1. Calculating inferential statistics for a single proportion
6m 6s
2. Calculating inferential statistics for a single mean
5m 39s
3. Calculating inferential statistics for a single categorical variable
4m 18s
8. ### 7. Charts for Two Variables

30m 43s
1. Creating clustered bar charts
7m 10s
2. Creating scatterplots
5m 8s
3. Creating time series
3m 24s
4. Creating simple bar charts of group means
4m 17s
5. Creating population pyramids
3m 0s
6. Creating simple boxplots for groups
3m 3s
7. Creating side-by-side boxplots
4m 41s
9. ### 8. Descriptive and Inferential Statistics for Two Variables

45m 28s
1. Calculating correlations
8m 17s
2. Computing a bivariate regression
6m 27s
3. Creating crosstabs for categorical variables
6m 34s
4. Comparing means with the Means procedure
6m 33s
5. Comparing means with the t-test
6m 4s
6. Comparing means with a one-way ANOVA
6m 30s
7. Comparing paired means
5m 3s
10. ### 9. Charts for Three or More Variables

24m 30s
1. Creating clustered bar charts for frequencies
6m 34s
2. Creating clustered bar charts for means
3m 45s
3. Creating scatterplots by group
4m 13s
4. Creating 3-D scatterplots
4m 25s
5. Creating scatterplot matrices
5m 33s
11. ### 10. Descriptive Statistics for Three or More Variables

30m 57s
1. Using Automatic Linear Models
11m 52s
2. Calculating multiple regression
9m 3s
3. Comparing means with a two-factor ANOVA
10m 2s
12. ### 11. Formatting and Exporting Tables and Charts

29m 29s
1. Formatting descriptive statistics
6m 1s
2. Formatting correlations
7m 49s
3. Formatting regression
10m 19s
4. Exporting charts and tables
5m 20s
13. ### Conclusion

51s
1. What's next
51s

### Start learning today

Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

### What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

### Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.

Exercise files

How to use exercise files.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.

Congratulations

You have completed SPSS Statistics Essential Training (2011).

Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

How to use exercise files.

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

• Mark video as unwatched
• Mark ALL videos as unwatched
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

## Are you sure you want to delete this note?

Thanks for signing up.

We’ll send you a confirmation email shortly.

• new course releases
• general communications
• special notices

Keep up with news, tips, and latest courses with emails from lynda.com.

• new course releases