首页 >
> 详细

Problem Set 2

Behavioral Economics, Fall 2019

The assignment is worth 100 points 100 points. There are 26 questions 26 questions. You should have the following packages installed:

library(tidyverse)

library(cowplot)

library(lfe)

library(stargazer)

In this problem set you will summarize the paper “Do Workers Work More if Wages Are High? Evidence from a Randomized Field Experiment”(Fehr and Goette, AER 2007) and recreate some of its findings.

1 Big picture

1. What is the main question asked in this paper?

2. Recall the taxi cab studies where reference dependence is studied using observational data. What can an experimental study do that an

observational study can’t?

3. Summarize the field experiment design.

4. Summarize the laboratory experiment design. Why was it included with the study?

5. Summarize the main results of the field experiment.

6. Summarize the main results of the laboratory experiment.

7. Why are these results valuable? What have we learned? Motivate your discussion with a real-world example.

2 Theory

Suppose the messenger’s utility function is

where is the wage rate in time , is the messenger’s e!ort, is the marginal utility of lifetime wealth, and is the

messenger’s cost function constant disutility of e!ort and exogenous disutility shock . Since , you can assume .

8. Show that the messenger chooses a level of e!ort so that the marginal benefit of working equals the marginal cost.

9. Show that the messenger in equilibrium responds to higher wages with higher e!ort.

10. Write an R function that calculates for di!erent levels of . Set default values of . Then use curve() to plot the labor supply for

.

11. Now suppose utility is given by

12. Show that how the messenger in equilibrium responds to higher wages depends on the reference point . (Hint: recall there are three cases to

consider.)

13. Once more write an R function that calculates for di!erent levels of . Set default values of , and . Then use

curve() to plot the labor supply for .

3 Replication

Use theme_classic() for all plots.

3.1 Correlations in revenues across firms

For this section please use dailycorrs.csv .

14. The authors show that earnings at Veloblitz and Flash are correlated. Show this with a scatter plot with a regression line and no confidence

interval. Title your axes and the plot appropriately. Do not print the plot but assign it to an object called p1 .

# your code here

15. Next plot the kernel density estimates of revenues for both companies. Overlay the distributions and make the densities transparent so they are

easily seen. Title your axes and the plot appropriately. Do not print the plot but assign it to an object called p2 .

# your code here

16. Now combine both plots using cowplot and label the plots with letters.

# your code here

3.2 Tables 2 and 3

For this section please use tables1to4.csv .

3.2.1 Table 2

On page 307 the authors write:

Table 2 controls for individual fixed e!ects by showing how, on average, the messengers’ revenues deviate from

their person-specific mean revenues. Thus, a positive number here indicates a positive deviation from the personspecific

mean; a negative number indicates a negative deviation.

17. Fixed e!ects are a way to control for heterogeneity heterogeneity across individuals that is time invariant. time invariant. Why would we want to control for fixed e!ects?

Give a reason how bike messengers could be di!erent from each other, and how these di!erences might not vary over time.

18. Create a variable called totrev_fe and add it to the dataframe. This requires you to “average out” each individual’s revenue for a block from

their average revenue: where is the fixed e!ect revenue for .

# your code here

19. Use summarise() to recreate the findings in Table 2 for “Participating Messengers” using your new variable totrev_fe . (You do not have to

calculate the di!erences in means.) In addition to calculating the fixed-e!ect controled means, calculate too the standard errors. Recall the

standard error is where is the standard deviation for treatment in block and are the corresponding number of observations. (Hint: use

n() to count observations.) Each calculation should be named to a new variable. Assign the resulting dataframe to a new dataframe called

df_avg_revenue .

# your code here

20. Plot df_avg_revenue . Use points for the means and error bars for standard errors of the means. Note the following:

To dodge the points and size them appropriately, use geom_point(position=position_dodge(width=0.5), size=4)

To place the error bars use

geom_errorbar(aes(x=block, ymin = [MEAN] - [SE], ymax = [MEAN] + [SE]),width = .1,position=position_dodge(width=0.5))

You need to replace [MEAN] with whatever you named your average revenues and [SE] with whatever you named your standard errors.

# your code here

21. Interpret the plot.

3.2.2 Table 3

22. Recreate the point estimates in Model (1) in Table 3 by hand (you don’t need to worry about the standard errors). Assign it to object m1 . To

recreate this model requires you to control for individual fixed e!ects and estimate the following equation:

where is the variable high , is the second block ( block == 2 ) and is the third block ( block == 3 ).

# your code here

23. Now recreate the same point estimates (ignoring the standard errors again) using lm and assign it to object m2 . You are estimating

where is the dummy variable for each messenger ( fahrer ).

# your code here

24. Now use the function felm() (https://www.rdocumentation.org/packages/lfe/versions/2.8-3/topics/felm) from the lfe package to recreate

Model (1), including the standard errors. Assign your estimates to the object m3 . You are estimating

where is the individual intercept (i.e. the individual fixed e!ect). Note that the function call works as follows:

felm([y]~[x] | [grouping variable] | 0 | [clustering varaible], [name of data])

# your code here

25. Compare the estimates in m1 , m2 and m3 . What is the same? What is di!erent? What would you say is the main advantage of using felm() ?

26. Recreate all of Table 3 and use stargazer() (https://cran.r-project.org/web/packages/stargazer/vignettes/stargazer.pdf) to print the results.

# your code here

yijt − y¯ = ( − ) + ( − ) + ( − ) + ( − ) ij β1 Hijt H¯ ij β2 B2ijt B2¯ ij β3 B3ijt B3¯ ij εijt ε¯ijH B2 B3

yijt − β0 + β1Hijt + β2B2ijt + β3B3ijt + ∑ +i= 1nαiFi εijtFi

yijt = αi + β1Hijt + β2B2ijt + β3B3ijt + εijtαi

联系我们

- QQ：99515681
- 邮箱：99515681@qq.com
- 工作时间：8:00-23:00
- 微信：codinghelp2

- Ee6435 Programming Homework 2020-05-30
- Computer Architecture Homework 3 2020-05-30
- Infs7450作业代做、Media Analytics作业代写、Pytho 2020-05-29
- 代写stats 782作业、代做r编程设计作业、代写data留学生作业、R课 2020-05-29
- 代写math223作业、R课程设计作业代做、代写data课程作业、R程序语言 2020-05-28
- 代写kxo151留学生作业、代做programming作业、Java语言作业 2020-05-28
- Math 160作业代做、Data课程作业代写、Matlab程序设计作业调试 2020-05-28
- 代做csci 3120作业、Program课程作业代做、C/C++语言作业代 2020-05-28
- St2020课程作业代做、Statistics作业代做、R程序设计作业调试、 2020-05-28
- Com1005作业代写、Ai Techniques作业代做、Java语言作业 2020-05-28
- 代写sit216留学生作业、Python程序语言作业调试、Java/C++实 2020-05-28
- 代写artificial课程作业、Java，Python程序语言作业调试、C 2020-05-27
- Comp Sci 3306作业代写、Python编程语言作业调试、代做jav 2020-05-27
- Data留学生作业代写、代做r课程设计作业、Analytics作业代做、R编 2020-05-27
- Csci 3120作业代做、C++程序语言作业调试、代做c/C++课程作业、 2020-05-26
- 代写algorithms作业、Data留学生作业代做、代写java、Pyth 2020-05-26
- Data Science作业代写、C++程序设计作业代写、Programmi 2020-05-26
- Data课程作业代写、C++编程设计作业调试、C/C++语言作业代做、Alg 2020-05-26
- 代写r留学生作业、代做data课程作业、代写r编程语言作业代做r语言编程|调 2020-05-25
- Cosc473作业代做、Systems作业代写、Python编程设计作业调试 2020-05-25