This repository contains codes for projects and homework for courses Applied Econometrics 3 (AAEC6317) and Demand and Price Analysis (AAEC63) at Texas Tech University.
Some of these codes are incomplete and should not be considered as a source of educational material other than providing suggestions on how to implement the relevant models in Stata and Python.
MonteCarlo_Simulations.ipynb applies common econometrics techniques to data-generating processes under the standard assumptions for Gauss-Markov theorem, as well as when those are violated: endogeneity, heteroskedasticity, auto-correlation.
Maximum_Likelihood.do implements maximum likelihood estimators (multinomial logit mlogit
, conditional logit asclogit
, and nested logit nlogit
) using Stata and the Fishing.xls dataset.
GMM.do includes examples for the application of the Generalized Method of Moments estimator, using Stata's gmm
.
Homework1.ipynb applies Maximum Likelihood techniques to different data generating processes, also relying on Stata for some estimations. The file Homework1.do has the replication code for Stata, which includes:
- Estimation of Box-Cox demand using
boxcox
, and using the user-inputted expression method for Maximum Likelihood Estimation (mlexp
). - Finite Mixture Models:
fmm
.
Replication data:
Question 1: data_1.xlsx.
Question 2: data_2.xlsx.
Maximum Likelihood estimations with marginal effects in Stata for discrete choice models and censored regressions, including:
- Multinomial Logit using
mlogit
- Alternative-specific conditional logit using
asclogit
- Nested logit using
nlogit
- Truncated and censored regressions under a variety of functional forms using
tobit
,truncreg
,nbreg
, andpoisson
. - Heckman's selection model using
heckman
The assignment and related datasets are described in Homework.pdf and available at the folder.
Includes exercises in Time Series using Python and Matlab.
Using Matlab:
- A simple attempt to replicate the CKLS model from Chan et al. (1992).
Using Python:
- Basic autocorrelation and stationarity analysis (Dickey-Fuller, Ljung-Box, etc.)
- Autoregressive (AR) models
- Conditional Heteroskedasticity models (ARCH, GARCH)
A rough draft where I use Fixed Effects and Maximum Likelihood Estimators to investigate whether corruption is more harmful to female-led businesses.
Using firm-level data from the World Bank Enterprise Surveys with around 130,000 observations in 133 countries, I ask whether female businesses are more likely to pay bribes and whether they report corruption as a bigger obstacle than their male counterparts.
An improved version of this project (with Dr. Jamie Bologna Pavlik) using Propensity Score Matching and Mahalanobis Distance Matching is available at SSRN.
Estimates demand models using Stata's nlsur
(Non-Linear Seemingly Unrelated Regression) function.
- Lab.do contains the main code. Other files in the folder contain templates for applying the AIDS model in R and Stata.
- labdata_2023.csv is the data sample used.
Includes some resources for estimating an EASI model in R, Python, and Stata.
- Homework.pdf presents the assignment.
- Homework.do answers questions one and three using Stata.
Questions include applications of nlsur
and quaids
functions. These can be used as templates for creating user-specified programs for demand estimation.
Replicates the differences-in-differences analysis from Card & Krueger (1994) and applies clustered wild bootstrap methods for inference using boottest
.