plumath124s16.files.wordpress.com€¦ · web viewmath 124. types of graphs. bar graph. a bar graph...

13
MATH 124 Types of graphs Bar graph A bar graph is used for categorical (qualitative data), that is when we want to represent how many items are in each category that is not numerical. For example: grades, colors, ethnicities, etc. Some bad practices in making bar graphs: Cutting off parts of the y-axis, like in the Chevy add we saw. Making the bars be different widths. Including too many bars to compare, like this example: Also avoid 3D bar graphs in Excel. They can distort data. How to make a bar graph in Excel: Enter your data into a table. Make sure that you give titles to your categories. Also make sure there are no blank spaces between your columns and that there are no missing cells. Select the entire table. Choose column chart from the options on top of the screen. You have a bar graph. Play around with the chart tools to make your graph look nicer – label the axes, include a title, etc. It is important for the person looking at your bar graph to immediately see what it is about and what it represents.

Upload: doandat

Post on 09-Aug-2019

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: plumath124s16.files.wordpress.com€¦ · Web viewMATH 124. Types of graphs. Bar graph. A bar graph is used for categorical (qualitative data), that is when we want to represent how

MATH 124

Types of graphs

Bar graph

A bar graph is used for categorical (qualitative data), that is when we want to represent how many items are in each category that is not numerical. For example: grades, colors, ethnicities, etc.

Some bad practices in making bar graphs:

Cutting off parts of the y-axis, like in the Chevy add we saw. Making the bars be different widths. Including too many bars to compare, like this example:

Also avoid 3D bar graphs in Excel. They can distort data.

How to make a bar graph in Excel:

Enter your data into a table. Make sure that you give titles to your categories. Also make sure there are no blank spaces between your columns and that there are no missing cells.

Select the entire table. Choose column chart from the options on top of the screen. You have a bar graph. Play around with the chart tools to make your graph look nicer – label the axes, include a title,

etc. It is important for the person looking at your bar graph to immediately see what it is about and what it represents.

Page 2: plumath124s16.files.wordpress.com€¦ · Web viewMATH 124. Types of graphs. Bar graph. A bar graph is used for categorical (qualitative data), that is when we want to represent how

Pie chart

A pie chart is also used for categorical (qualitative data), that is when we want to represent how many items are in each category that is not numerical. For example: grades, colors, ethnicities, etc. However, there are a few additional conditions to consider before deciding to use a pie chart:

It is not a good choice when there are too many categories. if there are more than 5 categories, a pie chart is often confusing.

A pie chart cannot be used if the data represented doesn’t add up to 100%. Pie charts are also really bad at comparing data. And finally, don’t use 3D pie charts. They look fancy but misrepresent data. Some people argue that there is no such thing as a good pie chart. I would say that it’s best

when you want to see the relationship between different parts that make up a whole.

Here are some examples of bad pie charts:

Too many categories:

Overlap of categories that also do not add up to 100%

Distorted appearance:

Page 3: plumath124s16.files.wordpress.com€¦ · Web viewMATH 124. Types of graphs. Bar graph. A bar graph is used for categorical (qualitative data), that is when we want to represent how

Categories clearly do not add up to 100%:

How to make a pie chart in Excel:

Enter your data into a table. Make sure that you give titles to your categories. Also make sure there are no gaps between columns and that all cells in the table are filled.

Select the entire table. Choose pie chart from the options on top of the screen. You have a pie chart. Play around with the chart tools to make your graph look nicer – label the axes, include a title,

etc. It is important for the person looking at your pie chart to immediately see what it is about and what it represents.

Page 4: plumath124s16.files.wordpress.com€¦ · Web viewMATH 124. Types of graphs. Bar graph. A bar graph is used for categorical (qualitative data), that is when we want to represent how

Line graph

A line graph is used for measurement (quantitative data), in particular to represent change of a quantity over time. You should only use a line graph in this context, and in no other situation.

Some bad practices in making bar graphs:

Cutting off parts of the y-axis and making the change look larger than it is. Here is an example:

Using a line graph for categorical data. The graph below implies that there was growth between bridge and cribbage, but that doesn’t make sense.

How to make a line graph in Excel:

Enter your data into a table. Make sure that you give titles to your categories. Also make sure there are no spaces between columns and that all cells in the table are filled.

Page 5: plumath124s16.files.wordpress.com€¦ · Web viewMATH 124. Types of graphs. Bar graph. A bar graph is used for categorical (qualitative data), that is when we want to represent how

Select the entire table. Choose scatter plot from the options on top of the screen. If you choose line graph instead, you

may end up with something like this, which is not what you wanted, since the days should be on the x-axis, and temperature should be on the y-axis.

You should have a line graph now. Play around with the chart tools to make your graph look nicer – label the axes, include a title,

etc. It is important for the person looking at your line graph to immediately see what it is about and what it represents.

Page 6: plumath124s16.files.wordpress.com€¦ · Web viewMATH 124. Types of graphs. Bar graph. A bar graph is used for categorical (qualitative data), that is when we want to represent how

Histogram

• A histogram is similar to a bar graph. The main difference is that the data categories have to be quantitative, and are actually grouped into bins. You decide what ranges of number to use for bins. In other words, the x-axis is always a number line, and the categories in the histogram are intervals on the number line.

• Note that the bars in a histogram should be touching each other. • To make things easier, make sure that your bins are always the same width.

Example from Math is Fun (https://www.mathsisfun.com/data/histograms.html):

You measure the height of every tree in the orchard in centimeters (cm)

The heights vary from 100 cm to 340 cm

You decide to put the results into groups of 50 cm:

The 100 to just below 150 cm range, The 150 to just below 200 cm range, etc...

So a tree that is 260 cm tall is added to the "250-300" range.

And here is the result:

You can see (for example) that there are 30 trees from 150 cm to just below 200 cm tall

Page 7: plumath124s16.files.wordpress.com€¦ · Web viewMATH 124. Types of graphs. Bar graph. A bar graph is used for categorical (qualitative data), that is when we want to represent how

How to create a histogram in Excel (from http://www.excel-easy.com/examples/histogram.html): 

METHOD 1: This will only work if you have Data Analysis installed on your computer.

1. First, enter the bin numbers (upper values of each interval – in this case, the bins will be: less than 20, 21-25, 26-30, 31-35, 36-40) in the range C3:C7.

2. On the Data tab, click Data Analysis.

3. Select Histogram and click OK.

Page 8: plumath124s16.files.wordpress.com€¦ · Web viewMATH 124. Types of graphs. Bar graph. A bar graph is used for categorical (qualitative data), that is when we want to represent how

4. Select the range A2:A19.

5. Click in the Bin Range box and select the range C3:C7.

6. Click the Output Range option button, click in the Output Range box and select cell F3.

7. Check Chart Output.

8. Click OK.

Page 9: plumath124s16.files.wordpress.com€¦ · Web viewMATH 124. Types of graphs. Bar graph. A bar graph is used for categorical (qualitative data), that is when we want to represent how

9. Click the legend on the right side and press Delete.

10. Properly label your bins.

11. To remove the space between the bars, right click a bar, select Format Data Series and change the Gap Width to 0%. Select Border Color to add a border.

Result:

Page 10: plumath124s16.files.wordpress.com€¦ · Web viewMATH 124. Types of graphs. Bar graph. A bar graph is used for categorical (qualitative data), that is when we want to represent how

METHOD 2: More manual work, fewer Excel commands

1. If your data is not already sorted, sort it now. You do that by clicking on the letter on top of that column and find the Sort & Filter button under the Home tab. Choose to sort from smallest to largest.

2. Pick your bin sizes. For example, if you are working with test scores, you can choose 50-59, 60-69, 70-79, etc. Make sure not to have overlap between categories, so you can’t have 50-60 and 60-70 because all scores of 60 will be counted twice. Write the bins in a separate column.

3. Count manually how many items are in each category and enter them in the corresponding cells. For example, if there are 5 scores between 50 and 59, you will enter 5 in the cell next to where you entered 50-59 (e.g. cells E5 and F5).

4. Give headings to both columns5. Select the entire table.6. Create a column graph. 7. To remove the space between the bars, right click a bar, select Format Data Series and change

the Gap Width to 0%. The process on a Mac is different – I will let you figure that out.

METHOD 3: Less manual work, more Excel commands

1. Pick your bin sizes. For example, if you are working with test scores, you can choose 50-59, 60-69, 70-79, etc. Make sure not to have overlap between categories, so you can’t have 50-60 and 60-70 because all scores of 60 will be counted twice. Write the bins in a separate column.

2. Use the COUNTIFS function to count the number of items in each category. You can find the function by clicking on fx located to the left of the function bar. The range for the function will be all the cells you entered, and the criteria will specify your bin. For example, for test scores between 60 and 69 your first criterion will be >59 and the second criterion will be <70. Note that you will have to enter the range for each criterion.

3. Give headings to both columns.4. Select the entire table.5. Create a column graph. 6. To remove the space between the bars, right click a bar, select Format Data Series and change

the Gap Width to 0%. The process on a Mac is different – I will let you figure that out.