Docsity

Statistics Exercies Review, Apuntes de Estadística Económica

Toggle sidebar
bg1
Econometrics I ·2018/19
Statistics Review: Exercises
One variable: review
1. Consider a random variable Zthat can only take five values, each of them with
the same probability:
Z={z1, z2, z3, z4, z5}.
Variable Zis a variable measured in thousands of euros.
(a) Provide the expressions that would define the expected value of Z,E(Z),
the variance, var(Z), and the standard deviation, sd(Z). Write the ex-
pressions in summation form.
(b) What information do each of the parameters included in (1a) provide about
the behavior of Z?
(c) Now consider that we are given the five values that Zcan take:
Z={1,2,3,4,5}.
With the help of a spreadsheet (Excel or alike) calculate the value of pa-
rameters E(Z),var(Z), and sd(Z), by defining the appropriate formulas
yourself. (That is, do not use the predefined functions available.)
(d) Now consider that variable Zis redefined in euros. That is, we perform a
change of units of measurement of Z. We relabel variable Zexpressed in
euros as Z∗. Hence, the five values that Z∗can take are now:
Z∗={1000,2000,3000,4000,5000}.
Modify the spreadsheet you created before and calculate E(Z∗),var(Z∗)
and sd(Z∗).
(e) Given your results above, would you say that the expected value of a vari-
able is unit-dependent or unit-free? And the variance? And the standard
deviation? Justify.
(f) Open Rstudio. Create a Rscript that allows you to enter the values of Z
for this population, and using functions mean(),var() and sd(), calculate
the following parameters: E(Z),var(Z)and sd(Z)and E(Z∗),var(Z∗),
sd(Z∗). Do the values you get coincide with your previous calculations?
Any differences? Any explanation why?
2. Define Z as a variable representing the result of rolling a fair die.
(a) Is Z a continuous or discrete random variable?
(b) Find the probability mass function of Z. Draw it (by hand). Label the
axes. Any known label for this kind of distribution?
3. Suppose that Z∼N(0,1). Using the help of the statistical tables provided by
R’s functions pnorm() and qnorm(), find the value of cfor each of the cases
listed below. For each case, draw (byhand) the plot that identifies cin each
case. Properly label both axes!
1
pf3
pf4
pf5

Vista previa parcial del texto

¡Descarga Statistics Exercies Review y más Apuntes en PDF de Estadística Económica solo en Docsity!

Econometrics I · 2018/

Statistics Review: Exercises

One variable: review

  1. Consider a random variable Z that can only take five values, each of them with the same probability: Z = {z 1 , z 2 , z 3 , z 4 , z 5 }. Variable Z is a variable measured in thousands of euros.

(a) Provide the expressions that would define the expected value of Z, E(Z), the variance, var(Z), and the standard deviation, sd(Z). Write the ex- pressions in summation form. (b) What information do each of the parameters included in (1a) provide about the behavior of Z? (c) Now consider that we are given the five values that Z can take: Z = { 1 , 2 , 3 , 4 , 5 }. With the help of a spreadsheet (Excel or alike) calculate the value of pa- rameters E(Z), var(Z), and sd(Z), by defining the appropriate formulas yourself. (That is, do not use the predefined functions available.) (d) Now consider that variable Z is redefined in euros. That is, we perform a change of units of measurement of Z. We relabel variable Z expressed in euros as Z∗. Hence, the five values that Z∗^ can take are now: Z∗^ = { 1000 , 2000 , 3000 , 4000 , 5000 }. Modify the spreadsheet you created before and calculate E(Z∗), var(Z∗) and sd(Z∗). (e) Given your results above, would you say that the expected value of a vari- able is unit-dependent or unit-free? And the variance? And the standard deviation? Justify. (f) Open Rstudio. Create a R script that allows you to enter the values of Z for this population, and using functions mean(), var() and sd(), calculate the following parameters: E(Z), var(Z) and sd(Z) and E(Z∗), var(Z∗), sd(Z∗). Do the values you get coincide with your previous calculations? Any differences? Any explanation why?

  1. Define Z as a variable representing the result of rolling a fair die.

(a) Is Z a continuous or discrete random variable? (b) Find the probability mass function of Z. Draw it (by hand ). Label the axes. Any known label for this kind of distribution?

  1. Suppose that Z ∼ N (0, 1). Using the help of the statistical tables provided by R’s functions pnorm() and qnorm(), find the value of c for each of the cases listed below. For each case, draw (byhand ) the plot that identifies c in each case. Properly label both axes!

(a) Prob {Z < c} = 0. 025 (b) Prob {Z > 1. 96 } = c (c) Prob {|Z| > c} = 0. 10

(d) Prob {Z > c} = 0. 025 (e) Prob {− 1. 96 < Z < 1. 96 } = c (f) Prob {|Z| > 1. 96 } = c

Examples of how to use these functions:

pnorm(3,5,2)

→ it gives us the P rob{Z < 3 } when Z is normally distributed with E(Z) = 5 and var(Z) = 4. That is, when Z ∼ N (5, 4). Notice standard deviation is the parameter entered as third argument in the pnorm() function. This function is also known as p − value finder.

qnorm(0.5,5,2)

→ Gives us the value c that makes the P rob{Z < c} = 0. 5 , when when Z ∼ N (5, 4).

  1. Knowing that Z 1 ∼ N (0, 1), what can you say about the distribution (type, expected value and variance) of the following variables:

(a) Z 2 = Z 1 · 4 (b) Z 3 = 2 + 4Z 1 (c) Z 4 = Z 12

  1. Assume the population of a given random variable Z is given by:

Z = { 6 , 7 , 6 , 8 , 5 , 7 , 6 , 9 , 10 , 6 }.

(a) Calculate E(Z) and var(Z), with the help of an R script.

(b) Suppose that instead of the whole population, we only have access to a sample of 3 randomly drawn observations: { 6 , 8 , 10 }. Calculate the sample mean, Z and the sample variance of Z, var̂ (Z).

(c) Suppose that we are given the following sample instead: { 6 , 5 , 9 }. Calcu- late again the sample mean, Z¯, and the sample variance of Z.

(d) Do you think that Z¯ is a random variable? What about the sample vari- ance? Justify your answer.

One variable: simulation

  1. Write a R script that generates 100 observations of a random variable Z ∼ N (0, 1). Just before the command that generates the observations, type the command set.seed( 1234 ) for replicability. Run the script. Once the observa- tions are generated, using the menu of the main window:

(a) find the density histogram of the observations of Z. Comment. (b) find the basic descriptive statistics of this variable. Comment.

(a) Provide the expression that would define the covariance between Z and W , cov(Z, W ). Provide the expression that would define the simple correlation coefficient between them, corr(Z, W ). Write the expressions in summation form. (b) What information do each of these parameters provide about Z and W? (c) Now consider that the five pairs of values that (Z, W ) can take are known:

Z W 1 2 2 4 3 6 4 8 5 10

With the help of a spreadsheet (Excel or alike) calculate cov(Z, W ) and corr(Z, W ), by defining the appropriate formulas. (I.e., do not used the functions already defined by the spreadsheet.) (d) Now consider that we change the units of measurement of variable Z from thousands of euros to euros:

Z∗^ W 1000 2 2000 4 3000 6 4000 8 5000 10

Modify the spreadsheet to calculate cov(Z∗, W ) and corr(Z∗, W ). (e) Given you results above, would you say the covariance is unit-dependent? And the correlation coefficient? Justify. (f) Using a R script enter values of (Z, W ) and using functions cov(), cor() and sd() calculate cov(Z, W ), corr(Z, W ) and cov(Z∗, W ), corr(Z∗, W ). Do the values you get coincide with your previous calculations? Any dif- ferences? Why?

  1. Prove that if there is an exact linear relation between two variables, Y = a+bX, with b 6 = 0, then the coefficient of correlation between X and Y is equal to 1 if b > 0 and equal to -1 if b < 0.
  2. Let z ≡

[

Z 1

Z 2

]

be a random vector. We know that E(Z 1 ) = 4, E(Z 2 ) = 8, V ar(Z 1 ) = 100, V ar(Z 2 ) = 49 and Cov(Z 1 , Z 2 ) = − 2 , find E(z) and V ar(z).

  1. Define:

z ≡

[

Z 1

Z 2

]

∼ N

([

]

[

])

(a) What can we say about E(z), V ar(z), E(Z 1 ), V ar(Z 1 ), E(Z 2 ), V ar(Z 2 ), Cov(Z 1 , Z 2 ), Cov(Z 2 , Z 1 ), Corr(Z 1 , Z 2 )? (b) What can we say about the distribution of Z 1? What about Z 2?

  1. Define:

z ≡

[

Z 1

Z 2

]

as a vector that includes random variables Z 1 and Z 2. For each of the following cases: (i) calculate the simple coefficient correlation between Z 1 and Z 2 (ii) comment on how do you think a sample of observations for (Z 1 , Z 2 ) would look in a 2-D scatter plot.

(a) V ar(z) =

[

]

(b) V ar(z) =

[

]

(c) V ar(z) =

[

]

  1. Consider the information given in question (15) regarding variables Z 1 and Z 2. For each of the cases considered,

(a) calculate var(Z 1 + Z 2 ), (b) calculate var(Z 1 − Z 2 ).

  1. Consider:

E(Z 1 ) = 8, E(Z 2 ) = − 3 and E(Z 3 ) = 5, V ar(Z 1 ) = 8, V ar(Z 2 ) = 4 and V ar(Z 3 ) = 16, Cov(Z 1 , Z 2 ) = 16, Cov(Z 1 , Z 3 ) = − 0. 2 and Cov(Z 2 , Z 3 ) = 9,

Detail E(z) and V ar(z) if z ≡

Z 1

Z 2

Z 3

  1. Consider that we have two random variables: Z 1 and Z 2 , with E(Z 1 ) = 4, E(Z 2 ) = 10, V ar(Z 1 ) = 2, V ar(Z 2 ) = 4 and Cov(Z 1 , Z 2 ) = 0. We define the following two variables: W 1 = 4Z 1 and W 2 = Z 1 + 3Z 2.

(a) Apply the properties of expected value, variance and covariance you know to find (i) E(W 1 ), E(W 2 ) (ii) var(W 1 ) , var(W 2 ) (iii)cov(Z 1 , Z 2 ) (iv) the type of distribution of W 1 and distribution of W 2.

Now, we want to repeat calculations in 18a but using vector notation. For it we define column vector z: z ≡

[

Z 1

Z 2

]

and introduce the following properties:

(P 1) E(Az) = AE(z) (P 2) var(Az) = Avar(z)A′

where A is matrix of constants.

(b) If E(z) = μ and var(z) = Σ, detail the elements of μ and Σ with the information provided above.

Two variables: application

  1. Sachs and Wagner (2001)’s article published at the European Economic Review focussed on finding empirical evidence of the so called ’natural resource curse’, that states that countries that are abundant in natural resources tend to have lower economic growth. File nr 97 .csv contains the data for 73 countries used by the authors. As a measure of abundance in natural resources in the period, they used the ratio of exports on GNP in 1980 (sxp 80 ). As a measure of economic growth, they used the average of annual growth rates between 1970 and 1990 (gea 7090 ). File includes additional variables to be considered later in the course.

(a) Import the data into Rstudio and calculate the correlation coefficient be- tween sxp 80 and gea 7090. Do you think that the value found supports the ’natural resource curse’ hypothesis? Comment. (b) Draw a scatter plot containing the 73 countries, placing gea 7090 and sxp 80 in the vertical and horizontal axes, respectively. Does the graph support the ’natural resource curse’ hypothesis? Comment.