Using Julia for Introductory Econometrics

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Introduces the popular, powerful and free programming language and software package Julia. Julia an ideal candidate for starting to learn econometrics and data analysis. As we will show in this book, learning Julia and the basics of econometrics are two goals that can be achieved very well together. And Julia is completely free and available for all relevant operating systems. When using it in econometrics courses, students can easily download a copy to their own computers and use it at home (or their favorite cafés) to replicate examples and work on take-home assignments. This hands-on experience is essential for the understanding of the econometric models and methods. It also prepares students to conduct their own empirical analyses for their theses, research projects, and professional work. This book does not attempt to provide a self-contained discussion of econometric models and methods. Instead, it builds on the excellent and popular textbook “Introductory Econometrics” by Wooldridge. It is compatible in terms of topics, organization, terminology, and notation, and is designed for a seamless transition from theory to practice. The first chapter provides a gentle introduction to Julia, covers some of the topics of basic statistics and probability presented in the appendix of Wooldridge, and introduces Monte Carlo simulation as an additional tool. The other chapters have the same names and cover the same material as the respective chapters in Wooldridge. Assuming the reader has worked through the material discussed there, this book explains and demonstrates how to implement everything in Julia and replicates many textbook examples. We also open some black boxes of the built-in functions for estimation and inference by directly applying the formulas known from the textbook to reproduce the results. Some supplementary analyses provide additional intuition and insights. Focus: implementation of standard tools and methods used in econometrics Compatible with "Introductory Econometrics" by Jeffrey M. Wooldridge in terms of topics, organization, terminology and notation Companion website with full text, all code for download and other goodies Topics A gentle introduction to Julia Simple and multiple regression in matrix form and using black box routines Inference in small samples and asymptotics Monte Carlo simulations Heteroscedasticity Time series regression Pooled cross-sections and panel data Instrumental variables and two-stage least squares Simultaneous equation models Limited dependent variables: binary, count data, censoring, truncation, and sample selection Formatted reports using Jupyter Notebooks

Author(s): Florian Heiss, Daniel Brunner
Publisher: UPfIE
Year: 2023

Language: English
Pages: 402

Preface
Introduction
Getting Started
Software
Julia Scripts
Packages
File Names and the Working Directory
Errors
Other Resources
Objects in Julia
Variables
Built-in Objects in Julia
Matrix Algebra in LinearAlgebra.jl
Objects in DataFrames.jl
Using PyCall.jl
External Data
Data Sets in the Examples
Import and Export of Data Files
Data from other Sources
Base Graphics with Plots.jl
Basic Graphs
Customizing Graphs with Options
Overlaying Several Plots
Exporting to a File
Descriptive Statistics
Discrete Distributions: Frequencies and Contingency Tables
Continuous Distributions: Histogram and Density
Empirical Cumulative Distribution Function (ECDF)
Fundamental Statistics
Probability Distributions
Discrete Distributions
Continuous Distributions
Cumulative Distribution Function (CDF)
Random Draws from Probability Distributions
Confidence Intervals and Statistical Inference
Confidence Intervals
t Tests
p Values
Advanced Julia
Conditional Execution
Loops
Functions
Computational Speed
Outlook
Monte Carlo Simulation
Finite Sample Properties of Estimators
Asymptotic Properties of Estimators
Simulation of Confidence Intervals and t Tests
Regression Analysis with Cross-Sectional Data
The Simple Regression Model
Simple OLS Regression
Coefficients, Fitted Values, and Residuals
Goodness of Fit
Nonlinearities
Regression through the Origin and Regression on a Constant
Expected Values, Variances, and Standard Errors
Monte Carlo Simulations
One Sample
Many Samples
Violation of SLR.4
Violation of SLR.5
Multiple Regression Analysis: Estimation
Multiple Regression in Practice
OLS in Matrix Form
Ceteris Paribus Interpretation and Omitted Variable Bias
Standard Errors, Multicollinearity, and VIF
Multiple Regression Analysis: Inference
The t Test
General Setup
Standard Case
Other Hypotheses
Confidence Intervals
Linear Restrictions: F Tests
Reporting Regression Results
Multiple Regression Analysis: OLS Asymptotics
Simulation Exercises
Normally Distributed Error Terms
Non-Normal Error Terms
(Not) Conditioning on the Regressors
LM Test
Multiple Regression Analysis: Further Issues
Model Formulae
Data Scaling: Arithmetic Operations Within a Formula
Standardization: Beta Coefficients
Logarithms
Quadratics and Polynomials
Hypothesis Testing
Interaction Terms
Prediction
Confidence and Prediction Intervals for Predictions
Effect Plots for Nonlinear Specifications
Multiple Regression Analysis with Qualitative Regressors
Linear Regression with Dummy Variables as Regressors
Boolean Variables
Categorical Variables
Breaking a Numeric Variable Into Categories
Interactions and Differences in Regression Functions Across Groups
Heteroscedasticity
Heteroscedasticity-Robust Inference
Heteroscedasticity Tests
Weighted Least Squares
More on Specification and Data Issues
Functional Form Misspecification
Measurement Error
Missing Data and Nonrandom Samples
Outlying Observations
Least Absolute Deviations (LAD) Estimation
Regression Analysis with Time Series Data
Basic Regression Analysis with Time Series Data
Static Time Series Models
Time Series Data Types in Julia
Equispaced Time Series in Julia
Irregular Time Series in Julia
Other Time Series Models
Finite Distributed Lag Models
Trends
Seasonality
Further Issues in Using OLS with Time Series Data
Asymptotics with Time Series
The Nature of Highly Persistent Time Series
Differences of Highly Persistent Time Series
Regression with First Differences
Serial Correlation and Heteroscedasticity in Time Series Regressions
Testing for Serial Correlation of the Error Term
FGLS Estimation
Serial Correlation-Robust Inference with OLS
Autoregressive Conditional Heteroscedasticity
Advanced Topics
Pooling Cross Sections Across Time: Simple Panel Data Methods
Pooled Cross Sections
Difference-in-Differences
Organizing Panel Data
First Differenced Estimator
Advanced Panel Data Methods
Getting Started with Panel Data
Fixed Effects Estimation
Random Effects Models
Dummy Variable Regression and Correlated Random Effects
Instrumental Variables Estimation and Two Stage Least Squares
Instrumental Variables in Simple Regression Models
More Exogenous Regressors
Two Stage Least Squares
Testing for Exogeneity of the Regressors
Testing Overidentifying Restrictions
Instrumental Variables with Panel Data
Simultaneous Equations Models
Setup and Notation
Estimation by 2SLS
Outlook: Estimation by 3SLS
Limited Dependent Variable Models and Sample Selection Corrections
Binary Responses
Linear Probability Models
Logit and Probit Models: Estimation
Inference
Predictions
Partial Effects
Count Data: The Poisson Regression Model
Corner Solution Responses: The Tobit Model
Censored and Truncated Regression Models
Sample Selection Corrections
Advanced Time Series Topics
Infinite Distributed Lag Models
Testing for Unit Roots
Spurious Regression
Cointegration and Error Correction Models
Forecasting
Carrying Out an Empirical Project
Working with Julia Scripts
Logging Output in Text Files
Formatted Documents with Jupyter Notebook
Getting Started
Cells
Markdown Basics
Appendices
Julia Scripts
Scripts Used in Chapter 01
Scripts Used in Chapter 02
Scripts Used in Chapter 03
Scripts Used in Chapter 04
Scripts Used in Chapter 05
Scripts Used in Chapter 06
Scripts Used in Chapter 07
Scripts Used in Chapter 08
Scripts Used in Chapter 09
Scripts Used in Chapter 10
Scripts Used in Chapter 11
Scripts Used in Chapter 12
Scripts Used in Chapter 13
Scripts Used in Chapter 14
Scripts Used in Chapter 15
Scripts Used in Chapter 16
Scripts Used in Chapter 17
Scripts Used in Chapter 18
Scripts Used in Chapter 19
Bibliography
List of Wooldridge (2019) Examples
Index