Wednesday, September 11, 2013

Statistical Analysis with Excel for Dummies (Notes) Charts (Clustered Column & Stacked Column Chart)

Some Fundamentals:

Excel uses the word "chart" instead of graph.  Most charts (pie chart being an exception) have a horizontal and a vertical axis.  The horizontal axis is called the x-axis and the vertical axis is called the y-axis.

What goes on the horizontal axis (x) is called the independent variable.  And what goes on the vertical axis (y) is called the dependent variable.  One of Excel's chart formats reverses that convention.  Excel calls that reversed-axis format a bar chart.

The terms independent and dependent imply that changes in the vertical direction depend (at least partly) on changes in the horizontal direction.

Inserting a Chart:

When you create a chart, you insert it into a spreadsheet  This immediately clues you that the chart creation tools are in the Charts area of the Insert tab.

Note:  In Excel a chart is dynamic.  This means that after you create a chart, changing its worksheet data results in an immediate change in the chart.

Creating a Clustered Column Chart:

1.  Enter your data into a worksheet (see image below)















2.  Select the data that go into the chart/  (A1:F7 above)

3.  In the Charts area of the Insert tab, select recommended charts.  The Clustered Column is the 5th chart down.

The image below is the resulting chart:





















To relocate the legend (the part below the x-axis that shows what the colors mean), right-click on the legend.  From the pop-up menu, select Format Legend.  This opens the Format Legend panel.  Select the Top Right Radio button to re-position the legend.

To format the axes, click on the y-axis and select the desired color.  Do the same for the x-axis.

To add the axis titles, select Design | Add Chart Element and Select Axis Titles

To add the chart title, click on the tile in the chart and type the new title.  When you add a title (whether axis or chart), you can either just select the title and start typing or you can highlight the title before you start typing.  If you type without highlighting, the new title appears in the formula bar and then in the title area after you press Enter.  If you highlight before you type, the title appears in the title area as you type.

This is what the chart looks like after the modifications:






















Stacked column chart:

If I had selected Excel's seventh recommended chart, I would have created a set of columns that presents the same information in a slightly different way.  Each column represents the total of all the data series at a  point on the x-axis.  Each column is divided into segments.  Each segment's size is proportional to how much it contributes to the total.

You can move a chart to a separate page in the workbook.  Select Design | Move Chart to open the Move Chart dialog box.  Select the New Sheet radio button to add a worksheet and move the chart there.  This is how the chart looks in it's new page:




























This is a nice way of showing percentage changes over the course of time.  If you just want to focus on percentages in one year, another type of graph is more effective (more later)/

Statisticians often use column charts to show how frequently something occurs.  For example, in a thousand tosses of a pair of dice, how many times does a 6 come up?  How many tosses result in a 7?

The x-axis shows each possible outcome of the dice tosses, and the heights of the columns show the frequencies.  Whenever the heights represent frequencies, your column chart is a histogram.

Excel provides a data analysis tool that does everything you need to create a histogram.  It's called, believe it or not, Histogram.  You provide an array of cells that hold all the data, like the outcome of many dice tosses, and an array that holds a list of intervals, like the possible outcomes of the tosses (2-12).  Histogram goes through the data array, counts the frequencies within each interval, and then draws the column chart.


No comments:

Post a Comment