You are on page 1of 9

7.

a) From the data given, the table can be constructed as followed


P
0.9
1.2

90
0.05
0.15
0.2

120
0.65
0.15
0.8

0.7
0.3
1

Expected return percentage can be calculated using the following equation


X = E*P 100
E(X)

= E(EP) 100
= 90*0.9*0.05 + 0.9*120*0.65 + 1.2*90*0.15 + 1.2*120*0.15 100
= 12.05

b) From the data given, the table can be constructed as followed


P
0.9
1.2

90
0.14
0.06
0.2

120
0.56
0.24
0.8

0.7
0.3
1

Expected return percentage can be calculated using the following equation


X = E*P 100
E(X)

= E(EP) 100
= 90*0.9*0.14 + 0.9*120*0.56 + 1.2*90*0.06 + 1.2*120*0.24 100
= 12.86

c) Covariance can be calculated using the following equation.


P
E

0.9
1.2

90
0.05
0.15
0.2

120
0.65
0.15
0.8

0.7
0.3
1

Cov(E*P)

= E(E*P) E(E)*E(P)
= 90*0.9*0.05 + 0.9*120*0.65 + 1.2*90*0.15 + 1.2*120*0.15 (0.9*0.7 +
1.2*0.3)(90*0.2 + 120*0.8)
= -0.81

Do-file:
use "C:\Users\nettokung\Desktop\student18.dta", clear //load data set
log using log18, text replace //open log file, named log18

correlate edu race region age year male uncov unmem wage //correlation of all variables
gen wagedollar = wage*1.58 //create new variable called wagedollar, assuming the unit for wage is in
pound and the exchange rate is 1.58 dollar/pound
save student18new, replace //save data in file named student18new
corr wage edu
corr wage edu, covariance
gen newwage = wage*10
gen newedu = edu*10
corr newwage newedu
corr newwage newedu, covariance

log close //close log

Log-file
-------------------------------------------------------------------------------name: <unnamed>
log: C:\Users\nettokung\Documents\log18.log
log type: text
opened on: 23 Jan 2013, 12:15:02

.
. correlate edu race region age year male uncov unmem wage //correlation of all
> variables
(obs=1000)

edu

race region

age

year

male uncov

-------------+--------------------------------------------------------------edu | 1.0000
race | -0.0404 1.0000
region | -0.0331 0.1081 1.0000
age | -0.0763 0.0045 -0.0234 1.0000
year | 0.0599 0.0136 -0.0243 0.0571 1.0000
male | 0.0171 -0.0496 -0.0295 -0.0100 -0.0443 1.0000
uncov | 0.0082 0.0177 -0.0868 0.1324 -0.0388 0.0524 1.0000
unmem | -0.0232 0.0173 -0.1001 0.1318 -0.0369 0.0562 0.9116
wage | 0.4532 -0.0446 -0.0183 0.1630 0.1696 0.3139 0.1174

| unmem

wage

-------------+-----------------unmem | 1.0000
wage | 0.1128 1.0000

. gen wagedollar = wage*1.58 //create new variable called wagedollar, assuming t


> he unit for wage is in pound and the exchange rate is 1.58 dollar/pound

. save student18new, replace //save data in file named student18new


file student18new.dta saved

. corr wage edu


(obs=1000)

wage

edu

-------------+-----------------wage | 1.0000
edu | 0.4532 1.0000

. corr wage edu, covariance


(obs=1000)

wage

edu

-------------+------------------

wage | 336131
edu | 670.164 6.50666

. gen newwage = wage*10

. gen newedu = edu*10

. corr newwage newedu


(obs=1000)

| newwage newedu
-------------+-----------------newwage | 1.0000
newedu | 0.4532 1.0000

. corr newwage newedu, covariance


(obs=1000)

| newwage newedu
-------------+-----------------newwage | 3.4e+07
newedu | 67016.4 650.666

.
. log close //close log
name: <unnamed>
log: C:\Users\nettokung\Documents\log18.log
log type: text
closed on: 23 Jan 2013, 12:15:02
-------------------------------------------------------------------------------As seen from the data presented above, multiplying the data by 10 will not change the correlation.
However the covariance will increase by 100 fold.

You might also like