Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ECON 471 Problem Set 1

1    Probability theory

1.1    Probability spaces and random variables

Below are some research questions. For each question, what is

(i) The sample space or population,” Ω;

(ii) An outcome ω Ω;

(iii) The random variable whose eect we are interested in, X;

(iv) The random variable that is affected, Y .

Note X and Y could be vectors!

Here’s an example.

Byrne  et al.  (2018)  ran  an  experiment in the state  of Victoria in Australia to see how electricity consumption of households vary with information on energy use. In the  experiment,  some households frequently received accurate  information  about their energy use,  as well as  that of their neighbors.   Other households received no such information.   They found that households  that overestimate  or underestimate their electricity consumption end up  consuming more  electricity when receiving the information on energy consumption. ”

In this paper, the population is the collection of households in Victoria, Aus- tralia.  ω is a single household.  X is the receipt of information on electricity con- sumption, and Y is electricity consumption.

1. Angrist and Evans (1998) investigate how the number of children in a household impact whether the mother works (i.e., is employed), as well as the number of hours worked each week. The study focuses on households in the US with two or more children. The estimates in the paper suggest that having a third child causes a 20% reduction in women’s labor supply (base rate of 57%).  For the women who work, there is a 25% reduction in the hours they work each week (base rate of 18.8 hours per week).

2. Baird et al. (2016) conducted an experiment in Kenya to estimate the long- run impacts of child health investment.  The authors introduced a deworming program across schools as the health investment.  Ten years later, the authors found that the children who received the deworming treatment enroll for more years of primary school, work 17% more hours each week, and experience a 2.8 percentage point decrease in miscarriage rates (relative to a 3.9% base rate) compared to the children who did not receive the treatment.

3. How much do parents value school quality?  Black (1999) came up with the clever idea of measuring school quality using housing prices. In Massachusetts, students can only enroll in the local schools if they live in the corresponding zone.  So the authors looked at how house prices vary across school districts in Massachusetts.   They found that a 5% increase in elementary school test scores leads to a 2.1% increase in the marginal resident’s willingness to pay for housing.

Suppose the Swedish government is trying to decide how to divide its funding be- tween a job training program, a cancer research program, and a university scholarship program. Sweden’s objective is to improve the wealth and health of its people.

4. What Ω, ω , X, and Y do the Swedish government care about?

5. Are the papers above going to be helpful for the Swedish government? Explain why.

Hint:  Think about what Ω , X, and Y are for Sweden, and compare those against Ω , X,  and Y from the papers  above.   You don’t need to make  every possible comparison, though!

Takeaway: Notice that the sample space and random variables depends on what the research question is.  However, if the sample space and/or random variables of a research papers are very different from the sample space and variables that we care about, then that research paper may not be that helpful for guiding our policy decisions. Papers that are only helpful in their own context have an external validity problem (not to suggest that the papers above have an external validity problem, though) .


1.2    Distribution of a function of random variables

Suppose we have two fair coins with one side labeled “0” and the other side labeled “1.” When ipping the coins, random variable X1  tells us which side of the rst coin faces up, and random variable X2 tells us which side of the second coin faces up. Here is the (joint) distribution of these two random variables.

X1  = 0   X1  = 1

X2  = 0

X2  = 1

1. What is the distribution of X1 ?

Hint:  How many cases do we have where X1  = 0?  What is the probability of either of those cases happening?

2. What is the distribution of X2 ?

Although we haven’t discussed averages yet in class, you are probably familiar with the idea.  If not, no worries, the instructions for how to calculate an average is shown below.

3. Recall that a random variable X is just a function mapping events in to the real space Rp , where p > 1.1    Then is a function of random variables still a random variable?  For instance, is g(X) = 3X + 5 a random variable?  Or if we have several random variables X1 , . . . , XK , is the average X =  k Xk  a random variable? Explain your answer.

Hint:  Take a look at the remaining questions and the takeaway paragraph.


4.  Stack your random variables together to get your random vector X, i.e.,  X =

(X1 , X2 )\ .   What is the distribution of the average of the coin tosses,  X  =  (X1 + X2 )?

Hint:  What would the averages be in each of the four possible outcomes?  What are the probabilities of those outcomes?

5. Now suppose you have three fair coins,  X1 ,  X2 ,  X3 .   Stack these variables together to get your random vector X,  i.e.,  X  =  (X1 , X2 , X3 )\ .   Then the support of X contains 8 elements,

,0    1    0          1

supp (X) =   0    ,  0    ,  1    , . . . ,  1   0 /   0 /   0 /          1 /

Each element in supp (X) occurs with probability 1/8 = 0.125.  What is the distribution of the average X =  (X1 + X2 + X3 )?

Takeaway:   One purpose  of this  exercise  is  to  let you practice  thinking  about random  variables  and their distributions.   The  other purpose  is  to  show  you  how distributions of simple averages can be tedious to calculate. For instance, notice how much more involved Question 5 is compared to 4— can you imagine having to calculate the distribution of an average of 100 coin tosses? Moreover, these coins only take on two values.  So what do we do when averaging random variables that take on many more values, like age or income?  Distributions of averages often tell us how reliable an  estimate  is,  so  it is something we  will want to  know.   Fortunately,  as  we  will see later when discussing statistical inference, there is a beautiful way to learn this distribution without tedious math.

2    Simulating an economic model by programming

This question is a gentle introduction to coding, which has now become essential in any empirical economic research. Please use a programming language like R, Python, Julia, or Matlab. Please do not use higher-level languages like Stata, SPSS, Eviews, and Excel. If you are not sure whether your programming language of choice is valid, just ask me if it is! If you are using R, I strongly encourage you to read the script r-basics .R on Canvas. Run it line by line to learn the basics of R. The exercises below will become quite easy if you do this.

Suppose you are a researcher and are interested in learning how wages depend on education for individuals. In this exercise, you will simulate a simple economic model to generate some data on wages and education.  Using this data, you will calculate some basic statistics and run a regression. Although we have not covered these topics yet, don’t be intimated—I will walk you through the exercises and show you how easy it is to do these things.2

1. Declare a variable N equal to 100.  This is how many observations/individuals we have in our data.

2. Now generate N draws from a uniform random distribution with support [0, 1] (that is, the interval from 0 to 1) and save it in some variable, e.g., unif .draws. In R, the function you want to use is runif.  Remember to set the seed rst!3

Note:  A random variable X  with a uniform distribution over [0, 1] is equally  likely to return any number between 0 and 1 . As a result, the probability X falls inside some interval contained in [0, 1] is equal to the length of the interval, e.g., the probability X is between 0 and 0. 1 is 0. 1 (10%) .

3.  Convert unif .draws into a data .frame and save it in another variable, e.g., data. In R, you can use the data .table function (this requires you to install the data .table package).

Hint: See Sections 10– 11 of r -basics .R .

4. Let’s use these random draws to generate how much education these individuals have. Assign the level of schooling according to Table 1. Store these assignments

in a new column in data, e.g., call it education.4

Hint: See Sections 10– 11 of r -basics .R .

Table 1: Determining level of education

Group

Education

unif .draws  <  0 . 09

Less  than  high  school

unif .draws  >=  0 . 09  &  unif .draws  <0 .37

High  school

unif .draws  >=  0 .37  &  unif .draws  <0 . 62

Some  college

unif .draws  >=  0 . 62  &  unif .draws  <0 . 86

College

unif .draws  >=  0 . 86

More  than  college

5. Thinking about random variables and their components, what are unif .draws and education analogous to?

Hint: See Section 10– 11 of r -basics .R .

6. Based on Table 1, what is the distribution of education? That is, what fraction

of the population has less than a high school degree? What fraction has only a high school degree? Etc.

Hint: See the note for Question 2. Also see Sections 10– 11 of r -basics .R .

7. Let’s now generate some baseline wages. Following Table 2, assign the baseline wages associated with each education level in a new column in data, e.g., call it base .wages.5

Table 2: Baseline hourly wages

Education

Base hourly wage ($)

Less  than  high  school

15.48

High  school

19.53

Some  college

22.50

College

32.63

More  than  college

41.25

8. Wages likely depend on more than just education, though.  So let’s introduce a skill variable.  Typically, skill is something researchers do not observe in the data.  Add a new column to data containing the skill of an agent, e.g., call the column skill.  Draw the skills from a standard normal distribution (i.e., normal distribution with mean 0 and variance 1; we will cover this later).  If you are using R, the function you want to use is rnorm.

9. Finally, generate the wage of the agent, equal to

wage = base .wage + 5 x skill.

Store this in a new column in data, e.g., call the column wage.

10. Report the mean and variance of the wage (we will cover these topics later). If you are using R, you will want to use the functions mean and var.

11. Report the mean and variance of the wage for agents with a college degree.

Economists often use linear regressions to get an idea of how one variable depends on other variables, e.g., how wage depends on education. Since we have not cov- ered regressions yet, the instructions below will give you a simple one-line command to do a regression. Later in the course, you will know what that command is actually doing.  Also, regressions only work with numerical variables, yet our education variable is not numerical.  We will discuss how this is dealt with later in the course as well.

12. Regress wage on education and report output.  Do not include skill in the regression, since this is something we usually do not observe in the data. If you are using R, the command you want to use is

lm(formula  =  wage  ~  0  +  education,  data  =  data)

● The argument formula tells R what regression to run.  So the formula above tells R, “Estimate how wages change with education.” The 0 in front

is there for a special reason we will cover later.  Feel free to try running the code without the 0!

● The argument data tells R what data frame to use to carry out the re- gression.

What is the output from your regression? Are the numbers close to the baseline wages in Table 2?

13. Notice how we generated skill and education completely separately. Does that seem strange to you? Do you think there should be a relationship between skill and education? Explain why or why not.

Takeaway: Hopefully, this was not too difficult, especially after reading r -basics .R . I just wanted you to have a crack at creating some variables, simulating and manip-ulating some data, and analyzing that data.  Econometricians do this all the time to test out new econometric methods.