Next…….

advertisement
MTH 105 In Class Activity – Spring 2011
Briana Mills
Analyzing Raw Data
The data for this exercise is in its raw form – that means there has been no analysis and each piece of data
is as it was when collected. In order to see patterns in the data it must be summarized. One tool for
summarizing the data is to use Excel pivot tables.
If you have access to tools with which you are comfortable for summarizing data, please proceed. If not,
following are instructions for creating pivot tables with Excel.
Open raw data file. Click on the Insert tab (red circle) at the top of MS excel, then select Pivot Table
(green circle) from top-left side of options.
You will get this box.
*If your box doesn’t look like this, go back to the data file and select the columns with data in the
worksheet, then click Insert and Pivot Table.
Click OK.
MTH 105 In Class Activity – Spring 2011
Briana Mills
Then your screen will look like this:
Drag the variable called sex from the Pivot Table Field List to the Row Labels in the bottom right corner.
Drag the variable called survived to the Column Labels in the bottom right corner.
Drag the variable called survived to the Values in the bottom right corner.
You should get a table that looks like this (if you don’t, then see the next page and a half… if you did
then skip the next page and a half until you see “Next…….”):
Count of
survived
sex
female
male
(blank)
Grand Total
survived
0
127
682
1
339
161
809
500
(blank)
***In this data set, 1=survived, 0=did not survive.***
Grand
Total
466
843
1309
MTH 105 In Class Activity – Spring 2011
Briana Mills
Notice: If you have 0’s in the columns counting the number of people who did not survive, as shown
below, you have to edit the summation values. (If not, then this step does not pertain to you.)
Sum of
survived
sex
female
male
(blank)
Grand Total
survived
0
0
0
1
339
161
0
500
(blank)
Grand
Total
339
161
500
Click on sum of values drop down in lower-left corner of screen. (You must be in the pivot table to see
this part of the screen.) Click on the drop down menu. You will see this:
Click on Value Field Settings to get this dialog box:
MTH 105 In Class Activity – Spring 2011
Briana Mills
Under the Summarize by tab, select Count.
Next…….
Make another pivot table comparing survival relative to age. (You’ve already made one comparing sex to
survival.)
The data set gives the age in exact years. To instead consider adults versus children, we need to use our
current data to classify people into these two categories.
Create another column in the worksheet called binary age (see red outline below). Your original data set
should now look something like this (without the red circle, of course!):
MTH 105 In Class Activity – Spring 2011
Briana Mills
Copy (or type) the following formula (including the equals sign) in the cells immediately below where
you typed binary age (this should be cell F2):
=IF(E2>=18,1,(IF(E2<=0,1,0)))
What is this formula doing? This formula returns a 1 for someone 18 and older and for the people
whose ages were not given, and a 0 for everyone else, which is the children. (Note: After looking at many
data points without ages, the creator of this project concluded the passengers without ages were more
likely adults than children based on their names. Children are denoted as Master or Miss. The data records
with no age were not designated in this way.)
To get this formula all the way down the chart, move your cursor to the lower right hand corner of the cell
onto the black box (circled in red). (Your cursor turning into a plus sign.)
Click on this and drag all the way to the bottom of the list. (It’s a long ways down!)
To make a pivot table comparing survival relative to age:
Go back to the data sheet. Highlight all columns with data (that’s A through F now!) and then click Insert
and Pivot Table.
MTH 105 In Class Activity – Spring 2011
Briana Mills
You will see this:
To add this pivot table to the same sheet as the last one, choose Existing Worksheet under Choose where
you want, then go to the bottom of your excel document and click on the tab for the worksheet where the
previous pivot table is stored. Then click on the cell in this worksheet where you want your pivot table.
The dialog box will look like this. (Your sheet number and cell number may be different.)
Click OK.
Drag the variable called binary age from the Pivot Table Field List to Row Labels in the bottom right
corner.
Drag the variable called survived to the column labels in the bottom right corner.
Drag the variable called binary age to the Values in the bottom right corner.
MTH 105 In Class Activity – Spring 2011
Briana Mills
Make at least one additional pivot table to explore the data more.
*Prepared by Marla Koch and updated by Briana Mills. She extends a special thanks to Rachel Webb and a nice guy
in the Denver airport for teaching her about pivot tables.
By the end of class, turn in one sheet per group that includes:
- All group members’ names.
your best definition at what a pivot table tells us
- at least 3 pivot tables
- a short summary about what you think this data is in reference to and why – you should use your tables to
help support your conclusion!!!. (Note: this is data from a large historical event known world wide.)
- Make sure (using print preview) that none of your tables split between pages, and do your best to print this
on one page (it’s ok if the font is small).
Download