# ECON403 – Econometrics 2

Prerequisite: ECON305 (751305)

## Course Description

Basic econometric tools, Econometrics for time series, cross sectional, and panel data, Econometric tools for other analyses.

## Course outline

This course will follow Part 2 and Part 3 of Wooldridge’s (2012) Introductory Econometrics: A Modern Approach.

**Midterm parts**

- Chapter 10: Basic Regression Analysis with Time Series Data
- Chapter 11: Further Issues in Using OLS with Time Series Data
- Chapter 12: Serial Correlation and Heteroskedasticity in Time Series Regressions

**Final Parts**

- Chapter 13: Pooling Cross Sections Across Time: Simple Panel Data Methods
- Chapter 14: Advanced Panel Data Methods
- Chapter 15: Instrumental Variables Estimation and Two Stage Least Squares

## Schedule

**Week 1: Introduction**

Fri 5 Jan: Class introduction

- Course description and contents
- Schedule
- Assessment and Grading
- Assignments

**Week 2: Chapter 10**

Tue 9 Jan: Introduction to time series analysis with regression model

- List down 5 time series data in economics you are interested
- What are those data, why they are important and who are responsible to collect and manage those data
- Two approaches to apply regression models for time series data i.e., causal model (X as other factors) and time trend model (X as time). Seasonality extraction using dummy variable.

Wed 10 Jan: TES2018 Conference (Full day)

Fri 12 Jan: TES2018 Conference (Oral presentation)

**Week 3: Chapter 10**

Tue 16 Jan

- How to download data from worldbank
- Basic Regression with R

R Code

# using hashtag for comments # Sample of regression model # call sample data in R library(datasets) ?datasets # call a list of datasets library(help = "datasets") # download mtcars data data(mtcars) mtcars ?mtcars # Creating a linear regression model # dependent var = mpg # independent vars = hp, wt # mpg = f(hp, wt) ?lm # 1. create an object of reg model model1 <- lm(mpg ~ hp, data = mtcars) # 2. call a model summary summary(model1) # mpg = 30.09886 - 0.06829 # plot the model plot(mtcars$hp, mtcars$mpg, col = "darkgreen") abline(model1, col = "firebrick") # check hypothesis par(mfrow = c(2, 2)) plot(model1)

**Tue 19 Jan**

- Sample regression model with time series data

Go to Google Slide here

- Download sample Data here
- R Code

# code # Regression with time series data # 1. Import dataset library(readr) mydata <- read_csv("C:/Users/Econ-lab/Desktop/403/mydata.csv") # 2. Create a time serie object in R mydata.ts <- ts(mydata, start = c(1960, 1), end = c(2017, 1), frequency = 1) # test plot ts data plot(mydata.ts) plot(mydata.ts, main = "A Time Series Plot of Inflation, Unemployment, GDP and Population") ?plot # see that data mydata.ts # 3. Develop a model # 3.1 create an object to store the simple regression model # dependent variable = inflation # independent variable = unemployment ?lm model1 <- lm(inflation ~ unemployment, data = mydata.ts) summary(model1) # Creating model 2 by adding population to model 1 model2 <- lm(inflation ~ unemployment + population, data = mydata.ts) summary(model2) # compare model1 vs model2 anova(model1, model2) # Our final static time series model is: # inflation = 2.5194 + 2.5194unemployment + 3.2230population # R square = 0.3057 # post hoc hypothesis checking par(mfrow = c(2, 2)) plot(model2)

**Week 4: Chapter 10**

Tue 23 Jan: Cancellation due to Graduation ceremony

Fri 26 Jan:

Workshop on running a regression model with time series data

**Week 5: Workshop**

Tue 30 Jan:

**1) Normality check (pre-test)**

# import data mydata <- read_csv("C:/Users/Econ-lab/Desktop/403/mydata.csv") # assumpion checking # 1. nornal distribution names(mydata) # normality check using boxplot boxplot(mydata$inflation) # normality check using skewness install.packages("psych") library(psych) skew(mydata$inflation) boxplot(mydata$inflation, main ="skew(inflation = 2.167)") # data transformation # for positive skew, we may take a sqaure root first boxplot(sqrt(mydata$inflation)) skew(sqrt(mydata$inflation)) boxplot(sqrt(mydata$inflation), main ="skew(sqrt(inflation) = 0.676)") # sqrt(inflation) is still positively skew, # so we can take a logarithm boxplot(log(mydata$inflation)) skew(log(mydata$inflation)) par(mfrow = c(1, 2)) # set output window to be 1x2 boxplot(mydata$inflation, main ="skew(inflation = 2.167)") boxplot(sqrt(mydata$inflation), main ="skew(sqrt(inflation) = 0.676)") boxplot(mydata$gdp) skew(mydata$gdp) boxplot((mydata$gdp^2)) skew((mydata$gdp^2)) # replot with title boxplot(mydata$gdp, main ="skew(gdp) = -0.965") boxplot((mydata$gdp^2), main = "skew(gdp^2) = 1.103")

**2) Writing up a report**

**Report Template**

Fri 2 Feb: Cancel

**Week 6: Chapter 11 – Report and Further Issues in Time Series**

Tue 6 February – Regression model with time series data

# import data mydata <- read_csv("C:/Users/Econ-lab/Desktop/403/mydata.csv") # assumpion cheching # 1. nornal distribution names(mydata) # normality check using boxplot boxplot(mydata$inflation) # normality check using skewness install.packages("psych") library(psych) skew(mydata$inflation) boxplot(mydata$inflation, main ="skew(inflation) = 2.167") # data transformation # for positive skew, we may take a sqaure root first boxplot(sqrt(mydata$inflation)) skew(sqrt(mydata$inflation)) boxplot(sqrt(mydata$inflation), main ="skew(sqrt(inflation) = 0.676)") # sqrt(inflation) is still positively skew, # so we can take a logarithm boxplot(log(mydata$inflation)) skew(log(mydata$inflation)) par(mfrow = c(1, 2)) # set output window to be 1x2 boxplot(mydata$inflation, main ="skew(inflation = 2.167)") boxplot(sqrt(mydata$inflation) , main ="skew(sqrt(inflation) = 0.676)") par(mfrow = c(1, 1)) boxplot(mydata$gdp) skew(mydata$gdp) boxplot((mydata$gdp^2)) skew((mydata$gdp^2)) # replot with title boxplot(mydata$gdp, # object to be plotted main ="skew(gdp) = -0.965", # Main title col = "blue") # colour boxplot((mydata$gdp^2), main = "skew(gdp^2) = 1.103", col = "lightblue") ### # writing up a model result # variables in use # sqrt(inflation) as a dependent variable # gdp as an explanatory/independent variable # start with simple regression ?lm # creat an object to store the simple regression model model1 <- lm(inflation ~ gdp, data = mydata) # call for regression outputs anova(model1) summary(model1) # regression model with transformed data model2 <- lm(sqrt(inflation) ~ gdp, data = mydata) anova(model2) summary(model2) ### gdp is not statistically significant (p < 0.05) skew(mydata$unemployment) skew(sqrt(mydata$unemployment)) skew(log(mydata$unemployment)) par(mfrow = c(1, 3)) boxplot(mydata$unemployment , main = "skew(unemployment)=1.378" , col = "red") boxplot(sqrt(mydata$unemployment) , main = "skew(sqrt(unemployment)=0.675" , col = "magenta") boxplot(log(mydata$unemployment) , main = "skew(log(unemployment)=-0.101" , col = "pink") # regress inflation with unemployment # untransformed variables model3 <- lm(inflation ~ unemployment, data = mydata) summary(model3) model4 <- lm(inflation ~ sqrt(unemployment), data = mydata) summary(model4) model5 <- lm(inflation ~ log(unemployment), data = mydata) summary(model5) # 262 get special score (sec 004) model6 <- lm(sqrt(inflation) ~ sqrt(unemployment), data = mydata) summary(model6) model7 <- lm(sqrt(inflation) ~ log(unemployment), data = mydata) summary(model7) ################################## # Summary # model 6 is the best for result # sqrt(inflation) = 2.9532 -0.6854sqrt(unemployment) # Multiple R-squared: 0.1165 ###################################

Fri 9 February – Cancel

**Week 7: Chapter 12**

Tue 13 February – Multiple Regression Model with Time Series data

skew(mydata$population) skew(sqrt(mydata$population)) par(mfrow = c(1, 1)) par(mfrow = c(1, 2)) boxplot(mydata$population, main = "skew(population = 0.135)", col = "blue") boxplot(sqrt(mydata$population), main = "skew(sqrt(population) = -0.132)", col = "lightblue") ################## # multiple regression # model8 = model6 + sqrt(population) model8 <- lm(sqrt(inflation) ~ sqrt(unemployment) + sqrt(population), data = mydata) summary(model8) ## test model improvement anova(model6, model8) # post hoc check/test plot(model6) # plot all 4 post hoc test simultenously par(mfrow = c(2, 2)) plot(model6) par(mfrow = c(1, 4)) plot(model6) plot(model8)

Fri 16 February: Cancellation (CMU Executive training)

**Week 8: Cancellation**

Tue 20 February

Fri 23 February

**Week 9: Midterm exam break**

**Week 10: Chapter 13**

Tuesday 6 March

**Wednesday 7 March MIDTERM EXAM 13:00 – 16:00 hours**

Friday 9March

**Week 11: Chapter 14**

Tuesday 13 March

Time Series Decomposition

Friday 16 March

**Week 12: No class**

Tuesday 20 March – No class

Friday 23 March – No cass

**Week 13: **

Tuesday 3 April

Friday 6 April

**Week 14:**

Tuesday 10 April – No class

Friday 13 April – No class

**Week 15:**

Tuesday 17 April – No class

Friday 20 April – No class

Sunday 22 April – Make up 9:00-16:00

**Week 16**

Tuesday 24 April

Friday 27 April

Sunday 29 April – Make up 13:00-16:00

**Week 17:**

Tuesday 1 May

Wednesday 2 May – Make up 9:00-16:00

## Grading

- A >= 80
- B+ >= 75
- B >= 70
- C+ >= 65
- C >= 60
- D+ >= 55
- D >= 50
- F <= 50

## Assessment

- Midterm = 25%
- Final = 25%
- Two Course Projects = 40% (20 each)
- Attention & In-class Quiz = 10%

## Exam

**Midterm:** 7th March 2018 13:00 – 16:00 hours

**Final:** 10th May 2018 15:30 – 18:30 hours

## Textbooks

## Slides

- To be upload

## Review of Time series Econometrics

R workshop with Rob J Hyndman’s FPP book (link)

## Assignments

**Time Series Data Analysis**

In a group of**three students**, pick an economic data in world bank website and analyse using econometric tools for time series econometrics taught in the class. Submit a report of 1,000 words with associated outputs (numbers and graphs) –

**Due date: before the midterm exam****Panel Data Analysis**

In a group of**three students**, please develop an econometrics model with panel data. Then write a 1,000 words of report. In the report, there should be a section explaining the duty of each member.

**Due date: before the Final exam**