Data representation via charts in Excel

advertisement
Data representation via charts in Excel
What type of chart to use for your data or what you want to explain
Note: while Excel does many different types of graphs (which they call “charts”), it
does not create all the different types that may be used in the social sciences. This is
a brief tutorial over what can be done using Excel 2007.
Pie Chart
A pie chart is used on categorical data and often is used to show the values of a
single variable. Categorical data is grouped into distinct categories like buckets.
Examples would be: gender, age groupings (0 – 10, 11 – 20, 31 – 40, etc), year in
college, type of job, ethic identification, etc. Pie charts are often effective in showing
relative percentages of values a variable can take in a situation. Another way to
think of it is to compare the parts or fractions in relationship to the whole, such as
categories in a budget. The chart below shows the percentage of students in each
class year at Generic University in 2000.
The data sheet for this type of graph usually consists of two columns such as in this
example:
Line Graphs
Line graphs show how two variables relate to one another. One variable’s values
are measured on the x-axis, and the other variable is measured on the y-axis. Points
are plotted to show how the two variables relate to one another, or how a change in
one value is associated with a change in the other. Using a line to connect each point
to its neighbor shows the trend or change.
One variable is often time, often drawn on the x-axis, so that the line graph is a timeseries graph, showing a change in a variable over a period of time.
To show multiple trends, you can put several lines in a line graph, perhaps
representing the correlation trend for different groups. The different lines can be
drawn in different colors, but often they are drawn with different line types – one
solid vs. a second one dotted. This is because colors can lose their distinction if the
graph is printed on a black and white printer or is shown on a poor projector. If you
publish to a journal or give a poster presentation, check the guidelines they give for
figures and graphs.
Current versions of Excel favor showing line graphs in color. It is possible to change
to black dashed styles, but it will take a bit more work.
Line graphs are very popular because they are clear and can show multiple series
easily. But be careful when setting the scale of each axis since they often represent
different units of measure. Some people will eliminate a zero point when plotting
interval data, but this can make a trend look far larger and more significant than it
really is. Be aware of this when reading graphs and when creating your own. It is
usually best to be sure that interval data is on a scale that starts at zero rather than
another value in the series.
This is the data used for both the line and bar graphs in this document:
Also note that the pie chart used just the data from the year 2000. So, you see that
different types of charts can be used on the same data. The pie chart is good for
showing distribution percentages for one year. The line chart shows how much
each class’s number of students varies from year to year. It is easy to follow the line
for each one, especially in color. But if you look at the same information in the bar
graphs (either horizontal or vertical), you can see more easily the relative
magnitude and compare the classes in each year quickly.
Bar Graphs
Bar graphs (aka “bar charts”) can be either horizontal or vertical. The main
difference between the two is the orientation of the chart. Horizontal bar graphs
show their values going horizontally, from left to right.
Figure 1: horizontal bar chart
In Excel, the vertical bar graph is called a “column” chart. The horizontal bar graph
is called a “bar” chart.
Figure 2: vertical bar chart
Vertical graphs show their values going vertically, from bottom to top. These are
especially useful for comparing numbers and magnitude.
Both types of bar graphs use the length of the bar to represent increased value of
variables. Both types of graphs can be used to show a comparison between items
and can be used to show a comparison of items over time as well or under different
conditions.
In contrast to pie charts, they can show a more complex situation with multiple
variables.
Vertical bar graphs are often used to show a frequency distribution, i.e. how many
or how often a particular value is seen in the data. However, if labels are too long to
fit on the x-axis (the bottom one in a graph), you may consider using a horizontal
graph to help the reader understand what you are counting since you have more
room for labels on the y-axis (the vertical) than you do on the x-axis (the
horizontal).
Scatter plot
Scatter plots (“scatter charts” in Excel) are used to compare two variables in
situations where there are many data points, the measurement intervals on the x
and/or y axis may be uneven, and you are looking for trends and groupings in the
data. They are like a line graph except that there is no attempt to draw a line
between points.
Points may cluster along a rough line, which then is used to extrapolate a
relationship between the values of x and y that is roughly true for the data, although
many data points will not be on that line in most scatter plots.
The chart below shows points where the average grade for the course is on the yaxis (vertical), and the average number of hours per week the student studied for
the course. You’ll notice that this graph can be a bit confusing. You’ll see it again
later and understand why manually adding labels can greatly enhance the value of a
graph!!
In this document, the scatter plot is based on completely different data than the
other graphs. It is best suited for looking for relationships between two variables
for a set of cases. In this graph, each dot represents a student’s grade and the
number of hours he or she studied for a class. Put all the cases together, and you can
see that generally, the more time you study for this class, the better you do.
Although this was not true for all students, it was true for most. Hence, there is a
correlation between study time and performance for this group of people in this
class.
Here is what part of the data looks like in Excel:
In order to get a good sample, I created 100 cases, which are not all shown here.
The data would not need to be sorted, but it made it easier for me to create for you
and does not affect how the graph is drawn.
Look down in the section about how to make charts more useful in Excel to see how
you can help make this scatter plot much more informative with a few changes.
How to create basic charts in Excel
1) Decide what type of chart to create and what it will illustrate in your paper or
presentation, using the above descriptions.
2) Create an Excel file and enter your data. Note that different charts will
require more data than others.
3) Select the range of data that you want to use for the chart
4) From the menu bar, choose “Insert”
5) From the insert menu, choose “Chart …”
6) From the charts ribbon, choose the type of chart to create
7) You will be shown a variety of options for the appearance/style of your
chosen chart type (called “layouts” in Excel). Unless you have a specific
purpose for an advanced layout, simple is usually more readable and robust
when printing or showing on a projector
8) Depending on your version of Excel, you may be asked whether to insert the
chart in the current sheet or on a new Excel worksheet. For this purpose, it
does not matter
9) Also, depending on your version of Excel, you may see a new formatting
palette (Mac OS) or a formatting tool bar/ribbon. The formatting tools will
help you create charts with labels and other helpful items (see the next
section)
10) To insert the chart in your Word document, click on the frame of the chart
(rather than some place in the middle of it). The cursor will change into an
arrow with a four-headed arrow. Right (alternate) click to bring up a menu.
Choose “save as picture”.
11) Name the graph and save it where you can find it. For inclusion in a Word
document, I usually choose JPEG as the format.
How to put the chart in your Word document
1)
2)
3)
4)
5)
6)
Open Word and navigate to where the graph should go.
From the menu bar, choose “Insert”
From the insert menu, choose “Picture”
From the options, pick “From File”
Choose the file you just saved your graph as
Click “Insert”
Ways to make charts more helpful
Excel has many ways to format a graph to make it informative and clear. BUT, you
should first check style guidelines from your professor, journal, or conference
organizer. Many publishers have very specific guidelines for how a graph should be
styled, sized, and whether or not it has a title or caption.
Chart Title
Give a brief explanation of what the chart shows by adding a title to the chart in
Excel. The title option is in the formatting toolbar (PC) or palette (Mac). Excel often
uses a default title based on headings in the spreadsheet, but you may need to
override or expand it for your readers’ benefit.
Keep the title short. It should be similar to a section title.
Caption
In Word, you can add a caption to any figure. This may be a place to include more
information about the chart than you can reasonably put in a title.
To add a caption in Word:
1) Open the document in Word
2) Click on the chart to select it
3) From the menu bar, select “Insert”
4) From the insert menu, select “Caption …”
5) Select the type of caption. For this, it should be “figure”, although notice that
you can also have equations and tables. Word will automatically keep track
of which number this captioned figure is in your paper and adjust the
caption number as needed.
6) Enter a brief description of what the figure shows your reader about your
data. In some journals, this figure can become separated from the
paragraphs describing it, which is why an informative caption may be very
helpful.
Legends
Legends in a graph are labels that explain what particular data are. In this pie chart,
the legend on the right explains class to color correspondence in the chart.
Excel generates automatic legends for many types of graphs, but others may need
some adjustment from you, the author, to explain what the x- and y-axes indicate
and the scale measures.
Most chart types allow you to add a legend for the x- and y-axis. You find this option
(when the chart is selected in Excel), on the formatting menu (PC) or palette (Mac).
To make the legend (on the right hand side of the graph) more accurately
descriptive (“case” rather than “grade”), I had to change the name of that column in
the Excel data sheet. Even when creating your data set, think about how to use
words and images to explain your data.
Figure 3: An example of a descriptive title and labels on the x- and y-axis.
When to use a table (instead of or in addition to) a graph
When you have extremes in your data, a reader may not be able to make much sense
of what you were trying to convey with a graph. When the data are:
 Extremely dispersed with extremely high and low values
 Extremely homogenous, where most of the values are nearly equal
 Very sparse, with two or three data points
 Very numerous
In these situations, a table with the data may be a better choice for organizing the
information in a readable form to support your argument.
Resources
http://www.statcan.gc.ca/edu/power-pouvoir/ch9/using-utilisation/5214829eng.htm - and excellent discussion in very readable format on different types of
charts and when you should and should not use each.
http://www.mindtools.com/pages/article/Charts_and_Diagrams.htm - walks the
reader through a series of questions to determine what type of graph may be most
appropriate.
Reding, E.E. & Wermers, L. (2008). Microsoft Office Excel 2007 Illustrated. Boston:
Thomson Course Technology.
Download