Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Exercise 1: Pivot Table

Finish 3 tasks by following the steps in slides:

1) Filling in the Table about “how to capture the effect of Terrain”

Length AADT Mountainous (M) Rolling (R) M/R ratio

<0.5 miles 0-1000

0.5-1.5 miles 1000-2000

2) Visualization for AADT (holding Segment Length constant)

--Brief discuss: Orderly? Increasing? What Function?

3) Visualization for Segment Length (holding AADT constant)

--Brief discuss: Orderly? Increasing? What Function?

Bonus: Visualization for Both AADT and Segment Length (3D chart)

1
Open ‘colorado
condensed’data

The data has been pre-processed from raw data:


• Holes were plugged, errors corrected but outliers may exist.
• To get an idea how crashes vary with ‘Segment Length &
‘AADT’, we computed five-year average AADT (1994-1998)
and sum of I&F crashes for 1994-1998.

2
Is there an orderly relationship linking E{μ} to Segment Length
and AADT? If yes, what does it look like?

To answer: Create a table with ‘AADT’ bins on the side, ‘Segment


Length’ across the top, and various stats in cells.
The ‘Pivot Table’ spreadsheet tool makes tabulations easy.

Move to ‘Data & Pivot’ workbook 1

3
Select: New Worksheet,
Must include headings row Click OK
4
This is what you now see:

5
Now this column opens

To here

6
Right click on any number in
the ‘Row Labels’ column to
open the ‘menu’.
Click on ‘Group’.
This will open

Change to 0
Change to 20,000

Click OK
7
Now the Row Labels turn to:
(If the field list disappeared,
click on Row Labels)

Now drag ‘Miles’


into the ‘Column
Labels’ area

8
Now the columns have to be ‘grouped’
As before, right-click on any
column label and select ‘Group’
in menu.

Choose:
0.5 and 20

Click OK

9
Now that the rows and columns are ready

Drag

10
This gets us the count of segments in each bin.

Good information No information

11
To get a different summary,
right-click anywhere within
the table to open:

1. Click

12
Number of crashes in each bin

Where we have a fair


number of crashes

13
To get the estimate of Ε{µ} for a bin divide the number of crashes
by number of segments in previous tables.
The Pivot makes it easy:
Right-click again within the table and choose ‘Average’.

14
To get crash count variances, right-click in table, go to
‘Summarize data by’ and then ‘more options’. From the
options choose ‘VARp’.

Sample Variances of crash counts:

15
What is the effect of Terrain? (Flat, rolling, mountainous)

16
How to capture ‘Terrain’?
Length AADT Mountainous Rolling M/R ratio
<0.5 miles 0-1000
0.5-1.5 miles 1000-2000

Increasing with
Segment Length
& AADT?
Implication for
modeling?

17
We asked two questions of the (initial) EDA?

1. Is there an orderly relationship?


(If not, do not add trait to SPF)
2. If yes, what function can represent it?

Visualization. 3D vs. 2D

18
Visualization for AADT(holding Segment Length constant)

• Orderly?
• Increasing?
• What function?

19
Visualization for Segment Length (holding AADT constant)

• Orderly?
• Increasing?
• What function?

20

You might also like