You are on page 1of 8

Cross table and scatter plot

Cross table

Background You have employment data about country X. You have been asked to prepare a cross-table sho
60% of 18 to 25-year-olds are employed
85% of 25 to 35-year-olds are employed
5% of 35 to 45-year-olds are unemployed
3% of 45 to 55-year-olds are unemployed
3% of 55 to 65-year-olds are unemployed
All 65+ are employed. Note: the definition of unemployed is: without a job, but actively searching
Task 1 Create a cross table summarizing the data you have been given.
Task 2 Create a side-by-side bar chart (it is called clustered column chart in Excel), in order to visually

Solution:
Employment by age group
Age group \ Employment % Employed Unemployed Total
120
18-25 60 40 100
25-35 85 15 100 100
35-45 95 5 100
45-55 97 3 100 80
55-65 97 3 100 60
65+ 100 0 100
Total 534 66 600 40
20
0
18-25 25-35 35-

Emplo
to prepare a cross-table showing that data.

a job, but actively searching for one. That's probably why all 65+s are employed.

Excel), in order to visually enhance your summary.

ent by age group

25 25-35 35-45 45-55 55-65 65+

Employed Unemployed
Cross table and scatter plot
Scatter plot

Background You are given the closing stock prices of Apple, Alphabet Inc. (Google) and Bank of America on different dates for a perio
Task 1 Create a scatter plot with Apple and Alphabet stock prices.
Task 2 Create a scatter plot with Apple and Bank of America stock prices
Task 3 Explore if there is a relationship between the two variables.

Solution: You may need to scroll down a bit for this one :)

Date Apple (AAPL) Alphabet (GOOGL) Bank of America (BAC)


1/3/2017 116.15 808.01 22.53 Apple - Google
1/4/2017 116.02 807.77 22.95
1200
1/5/2017 116.61 813.02 22.68
1/6/2017 117.91 825.21 22.68
1000
1/9/2017 118.99 827.18 22.55
1/10/2017 119.11 826.01 22.94

Alphabet CLass A
800
1/11/2017 119.75 829.86 23.07
1/12/2017 119.25 829.53 22.92
600
1/13/2017 119.04 830.94 23.01
1/17/2017 120 827.46 22.05
400
1/18/2017 119.99 829.02 22.63
1/19/2017 119.78 824.37 22.53
200
1/20/2017 120 828.17 22.64
1/23/2017 120.08 844.43 22.56
1/24/2017 22.95 0
119.97 849.53 110 115 120 125 130
1/25/2017 121.88 858.45 23.37
1/26/2017 121.94 856.98 23.44
1/27/2017 121.95 845.03 23.36
1/30/2017 121.63 823.83 22.95
Apple - Google
1/31/2017 121.35 820.19 22.64
2/1/2017 128.75 815.24 22.89 1100
2/2/2017 128.53 818.26 22.72
1050
2/3/2017 129.08 820.13 23.29
2/6/2017 130.29 821.62 23.12 1000
2/7/2017 131.53 829.23 22.9
Alphabet CLass A

2/8/2017 22.67 950


132.04 829.88
2/9/2017 132.42 830.06 23.12 900
2/10/2017 132.12 834.85 23.08
2/13/2017 133.29 838.96 23.4 850
2/14/2017 135.02 840.03 24.06 800
2/15/2017 135.51 837.32 24.58
2/16/2017 135.34 842.17 24.58 750
2/17/2017 135.72 846.55 24.52 700
2/21/2017 136.7 849.27 24.78 100 110 120
2/22/2017 137.11 851.36 24.79
2/23/2017 136.53 851 24.58
2/24/2017 136.66 847.81 24.23
2/27/2017 136.93 849.67 24.57
2/28/2017 136.99 844.93 24.68
3/1/2017 139.79 856.75 25.5
Apple - Bank of America
3/2/2017 138.96 849.85 25.23
3/3/2017 139.78 849.08 25.44 26
3/6/2017 139.34 847.27 25.25
3/7/2017 139.52 851.15 25.21 25
3/8/2017 139 853.64 25.26
Bank of America

3/9/2017 138.68 857.84 25.35 24


3/10/2017 139.14 861.4 25.31
23

22

21
25

Bank of America
24

3/13/2017 139.2 864.58 25.3 23


3/14/2017 138.99 865.91 25.32
3/15/2017 140.46 868.39 25.18 22
3/16/2017 140.69 870 25.22
3/17/2017 139.99 872.37 24.86 21
3/20/2017 141.46 867.91 24.44
3/21/2017 139.84 850.14 23.02 20
110 115 120 125 130
3/22/2017 141.42 849.8 22.94
3/23/2017 140.92 839.65 23.07 Ap
3/24/2017 140.64 835.14 23.12
3/27/2017 140.88 838.51 23.03
3/28/2017 143.8 840.63 23.48
3/29/2017 144.12 849.87 23.35
3/30/2017 143.93 849.48 23.87
3/31/2017 143.66 847.8 23.59
4/3/2017 143.7 856.75 23.59
4/4/2017 144.77 852.57 23.44
4/5/2017 144.02 848.91 23.17
4/6/2017 143.66 845.1 23.26
4/7/2017 143.34 842.1 23.16
4/10/2017 143.17 841.7 23.02
4/11/2017 141.63 839.88 22.92
4/12/2017 141.8 841.46 22.65
4/13/2017 141.05 840.18 22.34
4/17/2017 141.83 855.13 22.81
4/18/2017 141.2 853.99 22.71
4/19/2017 140.68 856.51 22.74
4/20/2017 142.44 860.08 23.07
4/21/2017 142.27 858.95 22.71
4/24/2017 143.64 878.93 23.63
4/25/2017 144.53 888.84 23.98
4/26/2017 143.68 889.14 23.89
4/27/2017 143.79 891.44 23.65
4/28/2017 143.65 924.52 23.34
5/1/2017 146.58 932.82 23.61
5/2/2017 147.51 937.09 23.53
5/3/2017 147.06 948.45 23.77
5/4/2017 146.53 954.72 23.85
5/5/2017 148.96 950.28 23.74
5/8/2017 153.01 958.69 23.96
5/9/2017 153.99 956.71 23.98
5/10/2017 153.26 954.84 24.15
5/11/2017 153.95 955.89 24.07
5/12/2017 156.1 955.14 24
5/15/2017 155.7 959.22 24.06
5/16/2017 155.47 964.61 23.99
5/17/2017 150.25 942.17 22.57
5/18/2017 152.54 950.5 22.74
5/19/2017 153.06 954.65 23.05
5/22/2017 153.99 964.07 23.04
5/23/2017 153.8 970.55 23.39
5/24/2017 153.34 977.61 23.36
5/25/2017 153.87 991.86 23.25
5/26/2017 153.61 993.27 23.24
5/30/2017 153.67 996.17 22.91
5/31/2017 152.76 987.09 22.41
6/1/2017 153.18 988.29 22.63
America on different dates for a period of 6 months.

oogle

T1: The first graph represents the relationship between Apple's sto
Alphabet's stock price is much higher (this is a financial decisi
stock price value does not mean much out of context. Most co
priced around $40 per share, since it has some advantages. If
can perform a stock split and have twice as big number of sha

Due to the discrepancy in the price, a much neater representa


where the axes are from 100 to 160, and from 700 to 1100.
The graph below shows the newly acquired scatter plot.

This example shows us that if the two dataset are too different

0 115 120 125 130 135 140 145 150 155 160 T3: As for the relationship between them, as you probably anticipa
When one is higher, the other is, too, and vice versa.
Apple

Google

00 110 120 130 140 150 160


Apple

e - Bank of America
T1: The graph represents the relationship between Apple's stock p

Since the our sample values are not that far apart, we don't ne

T3: We can clearly see, that when one stock is higher, this does n

There is almost no correlation between the stock prices of App


When you observe a scatter plot, where the data points look li
the two variables are not correlated.

115 120 125 130 135 140 145 150 155 160
Apple
ts the relationship between Apple's stock price and Alphabet's (Google) stock price.
much higher (this is a financial decision. Higher or lower
ot mean much out of context. Most companies prefer to be
hare, since it has some advantages. If your stock is price $80, you
t and have twice as big number of shares at $40)

n the price, a much neater representation would be a scatter plot


m 100 to 160, and from 700 to 1100.
the newly acquired scatter plot.

that if the two dataset are too different, it is a good idea to restrict the axes accordingly.

etween them, as you probably anticipated, the two stocks are very highly correlated.
other is, too, and vice versa.

e relationship between Apple's stock price and Bank of America's stock price.

lues are not that far apart, we don't need the correction from the previous example.

when one stock is higher, this does not imply the same for the other.

elation between the stock prices of Apple and Bank of America.


atter plot, where the data points look like this (somewhat vertical),

You might also like