Title: | Estimate Entry Models |
---|---|
Description: | Tools for measuring empirically the effects of entry in concentrated markets, based in Bresnahan and Reiss (1991) <https://www.jstor.org/stable/2937655>. |
Authors: | Guilherme Jardim [aut, cre], Arthur Bragança [ctb], Pedro Fernandes [ctb] |
Maintainer: | Guilherme Jardim <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.1 |
Built: | 2025-02-20 03:28:53 UTC |
Source: | https://github.com/gnjardim/entrymodels |
Build our auxiliary matrices to estimate entry models
aux_matrix(data, y, N_max, n)
aux_matrix(data, y, N_max, n)
data |
A |
y |
A string indicating the outcome variable |
N_max |
An |
n |
Number of observations in |
A list of the auxiliary matrices
Build our optimization function
br1(params, n, N_max, l_params, A1, A2, S, N)
br1(params, n, N_max, l_params, A1, A2, S, N)
params |
Parameters to construct function |
n |
Number of observations in |
N_max |
An |
l_params |
Length of parameters vector |
A1 |
Auxiliary matrix A1 |
A2 |
Auxiliary matrix A2 |
S |
Size of the market |
N |
Vector of zeros |
The function to be optimized
Build our optimization function
br2(params, n, N_max, A1, A2, S1, S2, N)
br2(params, n, N_max, A1, A2, S1, S2, N)
params |
Parameters to construct function |
n |
Number of observations in |
N_max |
An |
A1 |
Auxiliary matrix A1 |
A2 |
Auxiliary matrix A2 |
S1 |
First variable for size of the market |
S2 |
Second variable for size of the market |
N |
Vector of zeros |
The function to be optimized
Estimate entry model with two variables for the market size.
em_2var(data, Sm1, Sm2, y, N_max = 5, alpha0 = rep(0.1, N_max), gamma0 = rep(1, N_max))
em_2var(data, Sm1, Sm2, y, N_max = 5, alpha0 = rep(0.1, N_max), gamma0 = rep(1, N_max))
data |
A |
Sm1 |
A string indicating the main market size variable, present in |
Sm2 |
A string indicating the second market size variable, present in |
y |
A string indicating the outcome variable, present in |
N_max |
An |
alpha0 |
A |
gamma0 |
A |
A tibble with critical market sizes and estimated parameters, as explained in Bresnahan and Reiss (1991)
Guilherme N. Jardim, Department of Economics, Pontifical Catholic University of Rio de Janeiro
Bresnahan, T. F., & Reiss, P. C. (1991). Entry and competition in concentrated markets. Journal of political economy, 99(5), 977-1009.
tb <- data.frame(Sm1 = 1:5, Sm2 = 1:5, y = 1:5) # estimate default model em_n5 <- em_2var(tb, "Sm1", "Sm2", "y") # estimate model with 3 competitors only em_n3 <- em_2var(tb, "Sm1", "Sm2", "y", N_max = 3) ## Not run: # estimate model with different initial conditions em_difc <- em_2var(tb, "Sm1", "Sm2", "y", alpha0 = rep(0.2, 5), gamma0 = rep(1.1, 5)) # estimate model with example data tb <- load_example_data() em <- em_2var(tb, "Populacao", "RendaPerCapita", "n_agencias") ## End(Not run)
tb <- data.frame(Sm1 = 1:5, Sm2 = 1:5, y = 1:5) # estimate default model em_n5 <- em_2var(tb, "Sm1", "Sm2", "y") # estimate model with 3 competitors only em_n3 <- em_2var(tb, "Sm1", "Sm2", "y", N_max = 3) ## Not run: # estimate model with different initial conditions em_difc <- em_2var(tb, "Sm1", "Sm2", "y", alpha0 = rep(0.2, 5), gamma0 = rep(1.1, 5)) # estimate model with example data tb <- load_example_data() em <- em_2var(tb, "Populacao", "RendaPerCapita", "n_agencias") ## End(Not run)
Estimate basic entry model with only one variable for the market size.
em_basic(data, Sm, y, N_max = 5, alpha0 = rep(0.1, N_max), gamma0 = rep(1, N_max))
em_basic(data, Sm, y, N_max = 5, alpha0 = rep(0.1, N_max), gamma0 = rep(1, N_max))
data |
A |
Sm |
A string indicating the market size variable, present in |
y |
A string indicating the outcome variable, present in |
N_max |
An |
alpha0 |
A |
gamma0 |
A |
A tibble with critical market sizes and estimated parameters, as explained in Bresnahan and Reiss (1991)
Guilherme N. Jardim, Department of Economics, Pontifical Catholic University of Rio de Janeiro
Bresnahan, T. F., & Reiss, P. C. (1991). Entry and competition in concentrated markets. Journal of political economy, 99(5), 977-1009.
tb <- data.frame(Sm = 1:5, y = 1:5) # estimate default model em_n5 <- em_basic(tb, "Sm", "y") # estimate model with 3 competitors only em_n3 <- em_basic(tb, "Sm", "y", N_max = 3) ## Not run: # estimate model with different initial conditions em_difc <- em_basic(tb, "Sm", "y", alpha0 = rep(0.2, 5), gamma0 = rep(1.1, 5)) # estimate model with example data tb <- load_example_data() em <- em_basic(tb, "Populacao", "n_agencias") ## End(Not run)
tb <- data.frame(Sm = 1:5, y = 1:5) # estimate default model em_n5 <- em_basic(tb, "Sm", "y") # estimate model with 3 competitors only em_n3 <- em_basic(tb, "Sm", "y", N_max = 3) ## Not run: # estimate model with different initial conditions em_difc <- em_basic(tb, "Sm", "y", alpha0 = rep(0.2, 5), gamma0 = rep(1.1, 5)) # estimate model with example data tb <- load_example_data() em <- em_basic(tb, "Populacao", "n_agencias") ## End(Not run)
Load example dataset
load_example_data()
load_example_data()
Example dataset as tibble
Guilherme N. Jardim, Department of Economics, Pontifical Catholic University of Rio de Janeiro