Collective action function is R = B * P - C where: R = Reward, B = the benefit from the collective action, P = the probability of an individual’s action being effective in providing the good and C = the cost of participation.

We will first study P, which has its own function P = 1/N, where N = the number of people in the group

N <- seq(1,25) # generate a series of x values for the graph

 

p = 1/N # Calculates the vector of probabilities of the individual's action being decisive as the number of people in the group changes

d1 <- cbind(N, p)

d1 <- as.data.frame(d1)
# Graphing P = 1/N

p1 <- ggplot(d1, aes(x = N, y = p)) + geom_point( size = 2, color = "coral") + scale_fill_viridis() + cowplot::theme_cowplot(12) + ylab("Probability") +xlab("Size of group") +ggtitle("Individual Probability of decisiveness and Group Size")

ggplotly(p1)

## We will now consider the whole collective action function. ## As noted above, the collective action function is R = B * P - C. ## We will now graph R as function of group size.

B = 10
C = 2

R = (B * p) - C

d2 <- cbind(N, R)
d2 <- as.data.frame(d2)
p2 <- ggplot(d2, aes(x = N, y = R)) + geom_point(size =2, color = "Blue")+ cowplot::theme_cowplot(12) + ggtitle(
  "Collective Action Function") + ylab("Function Output") + xlab("Group Size") + geom_hline(yintercept = 0, linetype = "dashed", color = "dark red")

ggplotly(p2)

## Demand Curves

# Q = a + bP

a = 10
b = -1
P <- seq(1:20)

Q = a + b * P

data <- cbind(P, Q)
data <- as.data.frame(data)

ggplot(data, aes(P, Q)) + geom_line(color = "dark red", size = 1.3) + cowplot::theme_cowplot(12)