## Simulate a merger between two single-product firms in a
## three-firm market with linear demand with diversions
## that are proportional to shares.
## This example assumes that the merger is between
## the first two firms
n <- 3 #number of firms in market
price <- c(2.9,3.4,2.2)
quantity <- c(650,998,1801)
slopes <- matrix(
c(-2.3, 0.18, 0.28,
0.11, -2.4, 0.1,
0.13, .16,-2.7),ncol=n)
margin <- -1/diag(slopes)
#simulate merger between firms 1 and 2
owner.pre <- diag(n)
owner.post <- owner.pre
owner.post[1,2] <- owner.post[2,1] <- 1
result.linear <- linear(price,quantity,margin,ownerPre=owner.pre,ownerPost=owner.post)
print(result.linear) # return predicted price change
summary(result.linear) # summarize merger simulation
elast(result.linear,TRUE) # returns premerger elasticities
elast(result.linear,FALSE) # returns postmerger elasticities
diversion(result.linear,TRUE) # returns premerger diversion ratios
diversion(result.linear,FALSE) # returns postmeger diversion ratios
cmcr(result.linear) # returns the compensating marginal cost reduction
CV(result.linear) # returns representative agent compensating variation
## Implement the Hypothetical Monopolist Test
## for products 1 and 2 using a 5\% SSNIP
HypoMonTest(result.linear,prodIndex=1:2)
Run the code above in your browser using DataLab