Set-up and background

The assignment is worth 100 points. You should have the following packages installed:

library(tidyverse)
library(patchwork)
library(kableExtra)
library(margins)

In this problem set you will summarize the paper “Imperfect Public Monitoring with Costly Punishment: An Experimental Study” (Ambrus and Greiner, AER 2012) and recreate some of its findings.

1 Big Picture

[Q1] What is the main question asked in this paper?

The main question this paper asks concerns the effects increasing severe punishment technology has on social cooperation.

[Q2] Summarize the experiment design.

The experiment tested three different punishment groups: (1) No Punishment, (2) Regular Punishment, and (3) Strong Punishment. Each of these categories had a binary distinction on ‘noise’ which would determine the amount of information a group received for the decisions made by other group members. The groups in this experiment consisted of three random and anonymous people that remained in the same group for all 50 rounds.

For each round, the participants received 20 tokens which they could contribute -all or nothing- towards a group account. If the tokens were kept by an individual, their payout would be the 20 tokens. If an individual contributed to the group, all three members would then receive 10 tokens from that contribution. The groups knowledge of each members contribution was dependent on the presence of noise. With no noise, the decisions made by each member was made known to the group. With noise, the group is presented with an individuals public record which would always show if they made no contribution, however if they made a contribution, there was a 10% chance their public record would incorrectly show that no contribution was made.

Regarding the three different punishment groups, each had varying degrees severity. For group 1, a round concluded after each members decision was shown. For groups 2 and 3, punishment was introduced after public records were presented. The magnitude and included safety’s varied by punishment group, but the essence is that an individual could reduce their payoff by 1 point (up to 5) to punish another member by decreasing that members payoff by 3/6 points, respectively. For punishment group 2, punishment could not result in a negative payoff, whereas in group 3 it could.

[Q3] Summarize the main results of the experiment.

The results and possible implications here are fascinating. This experiment found a strong positive effect of punishment on contributions to the public good, with 2x stronger effects with severe punishments. The presence of noise interestingly has a significant and positive effect on the number of punishment points assigned, which significantly reduces net payoffs for regular punishments only.

A sort of equilibrium is found between non-contributors who are heavily punished and contributors who are wrongfully punished. A non-contributor is much more likely to contribute following severe punishment, while wrongfully punished contributors are not likely to reduce their contribution following punishment.

“It is not from the benevolence of the butcher, the brewer, or the baker…” This Adam Smith quote proves true in the No Punishment groups where a large majority become no-contribution groups over time.

For the regular punishment group, when decisions of other members are known, polarizing differences between contributing and non-contributing groups arise. However, with even slight uncertainty (noise) regarding other members decisions, this polarization is diminished. This group is significantly affected by the presence of noise.

For the strong punishment group there is less significance on noise and a majority of groups are full-contribution groups. Back to Adam Smith and self-interest, if not contributing likely results in a heavy punishment, then contributing quickly minimizes any costs an individual faces. However, what’s not so clear is whether or not this maximizes an individuals utility.

[Q4] Why are these results valuable? What have we learned? Motivate your discussion with a real-world example. In particular discuss the tradeoffs to transparency in groups and how these tradeoffs might be navigated in a firm, or more broadly, a society.

These results are valuable because they show social compliance can be achieved through punishment. On a macro level, a real world example would be the recently established Environmental, Social and Governance (ESG) factors that rank businesses on what are mainstream and believed to be socially dominant values. As this catches on, we might expect businesses with poor ESG scores to be regarded negatively by the public, or even companies with good scores receive more public/government support in times of need. By potentially losing consumers by not contributing to this score, a company will effectively be punished.

On a macro level, it’s a common sight today to see individuals not ‘contributing’ to these mainstream values get ‘cancelled,’ potentially losing their job or worse.

In a group setting, the eradication of doubt regarding others contributions increases overall cooperation. A firm could use this information with any projects by ensuring proper roles for each member to prevent any possible envy.

In society, a bleak use of this information could be through the digital eradication of individual privacy. Doing so would ensure that any decisions/actions made by an individual would not escape the public eye. If these actions did not align with what society deemed as proper behavior, the individual could face punishment. In a society like this fear of public shaming or other forms of punishment would greatly dissuade any non-conformity.

[Q5] If punishment is ineffective under imperfect monitoring, what else can you lean on to ensure people cooperate (at least a little) in a public goods problem?

As this study has found, people will be significantly more willing to participate if they know what contributions are being made by others in the group. If punishment cannot be used, clarity of information with with full transparency will positively affect group cohesion.

2 Theory

Payoffs to agent \(i\) are

\[ \pi_i = (e_i - x_i) + \alpha \sum_{i=1}^n x_i \]

where \(e_i\) is the agent’s endowment, \(x_i\) is her contribution to the public good, \(\alpha\) is the marginal per capita return, and \(n\) is the group size.

[Q6] Explain \(\alpha\) and why in public goods game requires \(\frac{1}{n} < \alpha < 1\).


\[ \alpha = \frac{\pi_1 - (e_i - x_i)}{\sum_{} x_i} \]


\[ \frac{1}{n} < \frac{\pi_1 - (e_i - x_i)}{\sum_{} x_i} < 1 \\ \]


\[ \frac{\sum_{} x_i}{n} + (e_i - x_i) < \pi_i < \sum_{} x_i + (e_i - x_i) \]

myPayoff <- function(x, pot, n, e){
  minPayoff = (pot / n) + (e - x)
  maxPayoff = pot + (e - x)
  
  return(c(x, pot, minPayoff, maxPayoff))
}
###


n = 3
e = 20
x = c(0,20)

limList = data.frame(matrix(ncol=4))
for(i in 0:(length(x)^2)){
  
  if(i == 0){
    agent = 20
    pot = 20
  }else{
    pot = e*(i-1)
    if(pot < n*e){
      agent = x[1]
    }else{
      agent = x[2]
    }
  }

  limList[i+1,] = myPayoff(agent, pot, n, e)
}

names(limList) <- c("agent contribution", "total contributions", 
                    "min. payoff", "max payoff")

kbl(limList, align='c') %>%
  kable_classic()
agent contribution total contributions min. payoff max payoff
20 20 6.666667 20
0 0 20.000000 20
0 20 26.666667 40
0 40 33.333333 60
20 60 20.000000 60

If no agents contribute alpha is not considered since it applies only to the total amount contributed. Since the pot is split evenly among players, an agent who makes the only contribution cannot receive a payout less than their contribution divided by the number of players. In this sense alpha acts as a multiplier ensuring an even distribution of the public funds. If this lower bound isn’t respected, the premise of public goods games would not hold. Furthermore, since the total amount will be fully accounted for, there cannot be an instance where all players contribute and all receive more than they’ve contributed. For the general premise to hold, each round must be a zero sum game which the limits on alpha ensure.

[Q7] Suppose \(e_i = e = 20\) (i.e. everyone has 20), \(\alpha = 0.4\) and \(n=4\). Show that \(x_i = 0\) is a symmetric Nash equilibrium, but \(x_i=20\) is the social optimum. (Recall that in a Nash equilibrium \(i\) cannot increase her payoff by changing her contribution.) Hint: you can use code to answer this problem by calcuting payoffs to a representative agent and plotting them. You might the curve() function useful.

# e = 20
# alpha = 0.4
# n = 4
payoff = function(x){
  #pi = (e - x) + alpha*(x + y)
  pi = (20 - x) + 0.4*(x + 3*20)
  
  return(pi)
}

x = 20
curve(payoff(x), from = 0, to = 20)

payoff = function(Xfeed, tot){
  if(Xfeed == 1){
    x = 20
  }else{
    x = 0
  }
  pi = (20 - x) + 0.4*(x + tot)
  return(pi)
}


possibilities <- expand.grid(0:1, 0:1, 0:1, 0:1)
names(possibilities) <- c("Agent1","Agent2","Agent3","Agent4")
head(possibilities)
##   Agent1 Agent2 Agent3 Agent4
## 1      0      0      0      0
## 2      1      0      0      0
## 3      0      1      0      0
## 4      1      1      0      0
## 5      0      0      1      0
## 6      1      0      1      0
combos <- possibilities[sample(1:16,8),1:4]
p1 <- combos %>% 
  pivot_longer(everything()) %>% 
  ggplot(data = ., aes(x=name, fill=name))+
  geom_bar(stat='identity', aes(y=value), col='blue')+
  ggtitle("Contributions per agent") + 
  theme_minimal()+
  theme(legend.position = 'none')+
  theme(axis.title.x=element_blank(),
        axis.ticks.x=element_blank())

  

# Calculating Payoff for each agent
for(i in 1:nrow(combos)){
  tot = sum(combos[i,])*20
  for(r in 1:ncol(combos)){
    Xfeed = combos[i,r]
    combos[i,r] = payoff(Xfeed,tot)
  }
}

p2 <- combos %>% 
  pivot_longer(everything()) %>%
  ggplot(data = ., aes(x=name, fill=name))+
  geom_bar(stat='identity', aes(y=value), col='blue')+
  ggtitle("Earnings per agent")+
  theme_minimal()+
  theme(axis.title.x=element_blank(),
        axis.ticks.x=element_blank())



p1 + p2

3 Replication

punnoise = read_csv("data/punnoise_data.csv")

3.1 Description

Use theme_classic() for all plots.

[Q8] Recreate Table 1 and usekable() to make a publication-quality table (in HTML).

punnoise %>%
  select(noise, punishment, p_reg, p_strong, 
         contribution, punishment_cost, income) %>%
  mutate(punishment = ifelse(p_reg == 1, "Regular punishment", 
                               ifelse(p_strong == 1, "Strong punishment", 
                                      "No punishment"))) %>%
  group_by(noise, punishment) %>%
  summarize(n = n()/50,
            avgC = round(mean(contribution), 2),
            avgP = round(mean(punishment_cost), 2),
            avgI = round(mean(income), 2)
            ) %>%
  mutate_all(~replace(., is.na(.), " ")) %>%
  kbl(col.names = NULL, 
      caption = "<center><strong>
      Table 1--Average Contributions, Punishment, and Net Profits in Treatments
      <center><strong>",
      align = "c") %>%
  kable_classic() %>%
  pack_rows("No Noise", 1, 3) %>%
  pack_rows("Noise", 4, 6)%>%
  add_header_above(c(" " = 1, " " = 1, 
                     "N \nparticipants" = 1, 
                     "Average \ncontribution" = 1,
                     "Average \npunishment" = 1,
                     "Average \nnet profits" = 1)) %>%
  remove_column(1)
N
participants
Average
contribution
Average
punishment
Average
net profits
Table 1–Average Contributions, Punishment, and Net Profits in Treatments
No Noise
No punishment 57 5.59 22.8
Regular punishment 57 12.4 0.64 23.66
Strong punishment 54 17.61 0.48 25.45
Noise
No punishment 57 4.04 22.02
Regular punishment 60 9.6 1.45 19.1
Strong punishment 54 16.04 0.65 23.48

3.2 Inference

Consider the linear model

\[ y = \alpha + \beta_1 x_1 + \beta_2 x_2 + \varepsilon \]

[Q9] Write down the marginal effect of \(x_1\) (in math).

y’ = b1

Now suppose you have a non-linear model

\[ y = F(\alpha + \beta_1 x_1 + \beta_2 x_2 + \varepsilon) \]

where \(F(\cdot)\) is a “link function” that compresses the inputs so that the output \(\hat{y} \in [0,1]\).

[Q10] Write down the marginal effect of \(x_1\). How does this compare to the marginal effect in the linear model?

y’ = F(a + b1x1 + b2x2 + e) * b1

This will multiply whatever value the linear model produces with the marginal effects of X.

[Q11] A probit model uses the Normal CDF \(\Phi\) as the link function, where \(\Phi' = \phi\) is the Normal PDF. Use glm() to estimate Model 1 in Table 2. Assign the model to the object m1. Cluster the standard errors at the group level.

m1 <- punnoise %>%
  summarize(con = as.factor(pnorm(contribution)), 
            x1 = round,
            x2 = p_reg,
            x3 = p_strong,
            x4 = noise,
            x5 = noise*p_reg,
            x6 = noise*p_strong) %>%
  glm(con~ x1 + x2 + x3 + x4 + x5 + x6, data=., family=binomial(link='probit'))

summary(m1, cluster = ~group)
## 
## Call:
## glm(formula = con ~ x1 + x2 + x3 + x4 + x5 + x6, family = binomial(link = "probit"), 
##     data = .)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0741  -0.8125   0.5018   0.9714   1.8030  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -0.5660869  0.0311397 -18.179  < 2e-16 ***
## x1          -0.0007022  0.0007303  -0.961   0.3363    
## x2           0.8894465  0.0345661  25.732  < 2e-16 ***
## x3           1.7600634  0.0400362  43.962  < 2e-16 ***
## x4          -0.2518140  0.0365821  -6.884 5.84e-12 ***
## x5          -0.1038117  0.0493212  -2.105   0.0353 *  
## x6          -0.0761898  0.0554592  -1.374   0.1695    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 23399  on 16949  degrees of freedom
## Residual deviance: 18848  on 16943  degrees of freedom
## AIC: 18862
## 
## Number of Fisher Scoring iterations: 4

[Q12] Interpret the coefficients. (For more on the probit model, see the appendix.)

The coefficients show the binary effects each variable has on the probability of contributions being made. In the presence of regular or strong punishment, there is a positive and significant effect on contributions for both. However, when noise is present in combination with either punishment, there are no significant effects for strong punishment and a significant and negative effect at the 0.05 level for regular punishment.

When noise is not in combination with any punishment, it alone significantly decreases the probability that contributions will be made.

3.2.1 Average marginal effects

[Q13] Table 2 reports the average marginal effects (AMEs) of the variables on \(P(\text{contribute})\). Calculate the AME to the variable round as follows:

  1. Use predict()to create an object predictions that contains the predicted z-scores. (i.e. \(\hat{\mathbf{X}\beta}\). Hint: use the option type="link" in predict().)
predictions = predict(m1, type = 'link')
  1. Use dnorm() to calculate the probabilities of the predicted z-scores and store the output in an object called index.
index = dnorm(predictions)
  1. Now calculate the marginal effects by multiplying the predicted probabilities times the estimated coefficient for round and store the output in dydxround.
dydxround = index*coef(m1)[2]
  1. Use mean() to calculate the AME.
mean(dydxround)
## [1] -0.0002208822

[Q14] Verify your calculations with margins(), the plot the AMEs. (Note: these will not be exactly the same as those in the paper, since the paper uses an outdated method in Stata.

(m <- margins(m1, data=m1$data))
##          x1     x2     x3       x4       x5       x6
##  -0.0002209 0.2798 0.5537 -0.07921 -0.03266 -0.02397
plot(m)

[Q15] Interpret the AMEs.

For each group, on average, the presence of regular/strong punishment increases the probability of contribution by ~28/55%.

The presence of noise insignificantly reduces the probability of contribution for each group by ~8%.

The other variables have little and insignificant effects.