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

Assignment 1

Empirical Finance: Methods and Applications

January 24th, 2023

● The data for problem 5 is available on insendi.

● You should submit a single pdf solution containing answers to all sub-parts of all problems (including 4-7). Typewritten solutions are preferred but handwritten and scanned solutions are acceptable. You may use R-markdown, LaTeX, or any other software to prepare your solution, but please prepare a PDF.

● Marks for each problem are listed below. If not specified, each sub-part within a problem is given equal weight.

● In addition, please submit code for problems 4-7 in the form of an R project. This should be a zipped folder that contains an R Project, a single R le with answers to all relevant parts of all problems, and all data files (including those for 5 and any you download for problem 7). I should be able to download and run your R le directly. Please comment your code to make it as easy to interpret as possible.

● Your marks depend on clarity of exposition in solutions and code. This includes gures and regression results.

● You may discuss all problems with classmates but each student must independently write and submit their own solution. Solutions and code that have been clearly copied will cause the full assignment to receive 0 marks and may invite further disciplinary action.

Problem 1: 15 Marks

Evaluate whether each of statements (a)-(c) below is True, False or Uncertain.  Explain the reasoning behind your answers. Your mark will depend on the quality and clarity of your explanation. Each is worth 5 marks.

(a)  Consider random variables yi  and xi . Define ei  = yi - E[yi |xi] and wi  = -xi(2) .

Statement (a): If Corr(yi , xi ) > 0 then Corr(ei , wi ) < 0.

(b)  Consider random variables yi  and xi .

Statement (b): Var(yi ) = Var(E[yi |xi]) + E[Var(yi |xi )].

(c)  Consider the impact of a binary treatment on some outcome yi . Let Di  be a treatment indicator equal to one if unit i receives treatment and 0 otherwise.  Let y0i, y1i  be potential outcomes for i. Define the selection effect as E[y0i|Di  = 1] - E[y0i|Di  = 0].

Statement (c): If the selection eect is equal to 0, then

E[yi |Di  = 1] - E[yi |Di  = 0]

is equal to the average treatment eect.

Problem 2: 10 Marks

(a)  Suppose we see 5 observations of yi , Di , shown in the table below:

yi       Di

-2

6

10

-6

8

Consider the following linear model:

0

1

1

0

1

yi  = δ0 + δ1 Di + vi .

Suppose we estimate this model on the data above via OLS. Please explicitly nd δˆ0(OLS)  and δˆ1(OLS) . You should not need to use a computer or calculator.

(b)  Consider the following difference-in-difference model for individual i in period t e (1, 2}: yit  = β0 + β1 Di  · Aftert + β2 Di + β3 Aftert + εit .

Here Di is an indicator variable denoting treated individuals and Aftert is an indicator variable equal to 1 in the 2nd period. Please compute OLS estimates βˆ0(ols) , βˆ1(ols) , βˆ2(ols)  and βˆ3(ols)  using the data below. You again should not need to use a computer or calculator.

yi

1

2

3

4

1

2

3

4

1

1

1

1

2

2

2

2

6

10

2

6

2

18

4

4

0

0

1

1

0

0

1

1

0

0

0

0

1

1

1

1

Problem 3 (10 Marks)

Relative to the United Kingdom, the United States has borrower friendly laws surrounding residential mort- gage default. Many US states are Non-Recourse —that is, if borrowers stop making the mortgage payments, lenders cannot hold them responsible beyond seizing the home itself.  On the other hand, the United King- dom has Full-Recourse: lenders may seize cars, investments, garnish wages, et cetera. Many believe that the relative leniency of laws in the United States is responsible for higher rates of mortgage default.

For the sake of simplicity, assume laws may take only two forms:  Non-Recourse  (in the United States) or Full-Recourse  (in the United Kingdom).  Imagine we are interested in the causal (treatment) effect of Non-Recourse laws on mortgage default.

(a)  Denote mortgage default for a borrower i by Di .  In potential outcomes notation, write the average

treatment effect of Non-Recourse laws on default. (3 marks)

(b)  Suppose we compare the average default rates in the United States to the average default rates in the

United Kingdom. Write this comparison in potential outcomes notation. (3 marks)

(c) Why does the expression in part (a) differ from that in part (b)? Please provide an explanation that is not simply mathematical, but that provides some intuition. Would you expect the answer in (b) to be higher or lower than that in (a)? Why? (4 marks)

Problem 4 (25 marks)

In this problem you will simulate and estimate a series of regression models. You should begin by setting a seed in R using the following command: set.seed(123).

(a)  Simulate 1000 draws of two independent random variables:  vi  ~ N(0, 1) and xi(*)  ~ N(0, 1).1 Generate

yi  as:

yi  = β0 + β1 xi(*) + vi

where β0  = 1 and β 1  = 0.5. Run a regression of yi  on xi(*) . Report your estimates βˆ0  and βˆ1 . (4 marks)

(b)  Generate xi  = xi(*)  + ηi  where ηi  ~ N(0, 1) is independent of xi(*)  and vi . Run a regression of yi  on xi . Report your estimate of βˆ1 . Is it meaningfully different from your estimate in part (a)? Explain why or why not. (4 marks)

(c)  Rerun the simulations and regressions in parts (a) and (b) 1000 times, saving the coefficients from each iteration.2 Create a histogram of your estimates βˆ1  from the regression in (a) and a separate histogram of the estimates from the regression in (b). (4 marks)

(d)  Repeat part (b), but suppose instead that ηi  ~ N(0, 10). Maintaining this assumption, rerun the simu- lation and regression from part (b) 1000 times and create a histogram of your estimated βˆ1  coefficients. Are these estimates meaningfully different from your estimate in part (b)? Explain why or why not. (4 marks)

(e)  Repeat part (b), but suppose instead that ηi  ~ N(0, 0.5). Maintaining this assumption, rerun the simu- lation and regression from part (b) 1000 times and create a histogram of your estimated βˆ1  coefficients. Are these estimates meaningfully different from your estimate in part (b)? Explain why or why not. (4 marks)

(f)  Generate y˜i  = yi  + ei  where ei  ~ N(0, 1) is independent of yi .  Run a regression of y˜i  on xi(*) .  Rerun the simulation of xi(*)  and y˜i  and the regression 1000 times and create a histogram of your estimated βˆ1 coefficients. Are your estimates meaningfully different from that in part (a)? Explain why or why not.

(5 marks)

Problem 5 (15 marks)

The dataset rollingsales manhattan.xls contains details on 2020 real estate transactions in Manhattan.3 (a)  Load the data into R and perform the following basic data cleaning exercises: 4

● Relabel the column names to remove any spaces

One trick is names(dataset) < - gsub(” ”, ” ”, names(dataset).

● Remove any observations with the sale price equal to 0.

Using this cleaned data, what neighborhood has the highest average sale price? (4 marks)

(b)  Create a new variable equal to log(sale price).   Create another variable representing the age of the

property in 2020 (i.e.  years since the year it was built).  Run an OLS regression of log(sale price) on age and a set of dummy variables for each neighborhood (omitting one). Report the coefficient on age. What does this indicate about the relationship between age and sale price in the sample as a whole? (4 marks)

(c)  Run an OLS regression of log(sale price) on age, but use only data from the Upper East Side below 79th street.5 Report the coefficient on age. What does indicate about the relationship between age and sale price in this particular neighborhood. (4 marks)

(d)  Plot the mean and median sale price and the total quantity of sales across months in 2020. This can be on multiple gures or a single gure, and you may choose the plotting style that you feel best presents the data. Please comment on and discuss any major patterns you see in these plots. (4 marks)

(e)  Create a chart showing a new (and hopefully interesting) pattern of your choice using this data.  This

may be a plot of any type, and may relate to the sale price or not. Please briefly describe the plot you have created. (4 marks)

Problem 6 (15 marks)

In this problem you will simulate and estimate a difference-in-difference model. You should begin by setting a seed in R using the following command: set.seed(123). Please follow the steps below to generate your data:

● Create a panel dataset with 100 units (i e (1, 2, . . . , 100}) and 10 time periods (t e (1, 2, . . . , 10}).

● Randomly select 50 of the units to be treated, and generate Di  = 1 for treated units in all periods.

● Define the variable Aftert  = 1 if t > 5.

● Simulate the outcome yit  according to the following data generating process:

yit  = -2 + 3 · Di · Aftert + 5 · Di + 2 · t + εit

where εit  follows a standard normal distribution (that is, εit  ~ N(0, 1)).

(a)  Create a line plot of the mean of yit  over time for the group of treated units (that is, take the average

within each time period, and create a plot that shows periods 1-10). On the same plot, show the mean of yit  over time for the remaining, non-treated, units.

(b)  Run the following difference-in-difference regression using your data:

yit  = β0 + β1 Di · Aftert + β2 Di + β3 Aftert + ei .

Report your estimates of βˆ0(ols) , βˆ1(ols) , βˆ2(ols)  and βˆ3(ols) .

(c)  Create a new outcome y˜it  according to the following data generating process:   y˜it  = -2 + 3 · Di  · Aftert + 5 · Di + 2 · t · Di + νit

where νit  follows a standard normal distribution (that is, νit  ~ N(0, 1)). Create a line plot of the mean of y˜it  over time for the group of treated units. On the same plot, show the mean of it  over time for the remaining, non-treated, units.

(d)  Run the following difference-in-difference regression:

y˜it  = γ0 + γ1 Di · Aftert + γ2 Di + γ3 Aftert + vi .

Report your estimates of 0(ols) , 1(ols) , 2(ols)  and 3(ols) .

(e)  Compare your estimates of 1  and βˆ1 . Why do the two dier?

Problem 7 (10 marks)

Create a single compelling plot of your choice using nancial data and ggplot.

● You must download or otherwise acquire some nancial or nancially relevant data. This may be from Bloomberg, an online provider (e.g. Yahoo Finance or fred.stlouisfed.org), or any other source.

● Your plot should demonstrate an interesting stylized fact.  This could be, for example, the short run price response of an asset or group of assets to some salient event, long run changes in investor ows, or anything that you nd exciting.  Please be creative and try to identify something that I or your classmates might nd interesting.

● Each student must perform this task individually. You are responsible for acquiring data yourself. You may not use data that has been downloaded by a classmate and you may not produce the same plot as a classmate.

● Your answer to this question should cover a single page. The top half of the page will contain the plot, the bottom half will contain an explanation of the stylized fact. Feel free to supplement with regression analysis or other support from the data.

● Your graph will be judged on clarity. Pay attention to labeling and scaling.

● I will select a few interesting plots to present and discuss in class (with permission of the authors).