Skip to content

ECON 304 – Economic Statistics

Course outline

  1. Index number 
  2. Time series data
  3. Simple Regression Analysis
  4. Multiple Regression
  5. Writing the economic statistics report


  1. A >= 80
  2. B+ >= 75
  3. B >= 70
  4. C+ >= 65
  5. C >= 60
  6. D+ >= 55
  7. D >= 50
  8. F <= 50


  1. Midterm = 30
  2. Final = 30
  3. Quiz = 10
  4. Course Projects (Time series and regression) = 20
  5. Attention = 10


Midterm: 1st October 2017 15:30 – 18:30 hours, ECB 1207

Final: 7th December 2017 12:00 – 15:00 hours


  • Enrico Giovannini, 2008. Understanding Economic Statistics: An OECDPerspective. (download)


  1. Time Series
    In a group of three, pick a country of origin and analyse number of tourist arrivals to Thailand by applying index number and time series decomposition technique. Submit a report of 1,000 words with associated outputs (numbers and graphs) –
    Due date: before the midterm exam
  2. Regression Model
    In a group of three students, please develop a multiple regression model to predict any economic variable using atleast five predictors 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
    See a sample here
    emplate: doc, pdf



1. Introduction to Economic Statistics

download pdf slide of index here

2. Index number

Introduction to R programming

#hashtag will be ignored by R

# R is object oriented.
# Everything will be kept as an object

# create an object called 'econ'
econ &amp;amp;amp;lt;- 10

# R is case sensitive

Econ &amp;amp;amp;lt;- 11

# new command will replace the old one
econ &amp;amp;amp;lt;- 12

Econ &amp;amp;amp;lt;- c(10, 11, 12)

Econ * econ

ECON &amp;amp;amp;lt;- Econ * econ

Econo &amp;amp;amp;lt;- (Econ * econ)^n

n &amp;amp;amp;lt;- 5


# Now we will import the data

gold_data &amp;amp;amp;lt;- read.csv(C:/Users/ECB2401-TEACHER/econ304/gold_data.csv)

# Create price relative as a new column
gold_data$price_relative &amp;amp;amp;lt;- gold_data$price/gold_data[1, 2]

# Your turn is to create price index (base of 1/1/1860) ???
# And shout out the price index of 1/6/2014

# just copy the old code and change the row from 1 to 121
gold_data$price_relative1960 &amp;amp;amp;lt;- gold_data$price/gold_data[121, 2]
gold_data$price_index1960 &amp;amp;amp;lt;- gold_data$price_relative1960 * 100

# for the new base year of 1990 (30*12)
gold_data$price_relative1990 &amp;amp;amp;lt;- gold_data$price/gold_data[481, 2]
gold_data$price_index1990 &amp;amp;amp;lt;- gold_data$price_relative1990*100

3. Time Series 

Data: Tourist Arrivals to Thailand by Nationality (dropbox link)


Screen Shot 2016-06-19 at 09.05.36

R -Code

# ECON304
# Time Series Analysis

# Import data

chinese_data &amp;amp;amp;lt;- read.csv(&amp;amp;amp;amp;amp;amp;quot;~/Dropbox/Works/CMU/CMSE/Teaching/ECON 304/Data/Time Series/raw_chinese_tourists_data_only.csv&amp;amp;amp;amp;amp;amp;quot;, sep=&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;quot;)

# Transform to time serie data format
chin.ts &amp;amp;amp;lt;- ts(chinese_data, start = c(2008,1), end = c(2016, 5), frequency = 12)

# plot the time serie data

# Moving average
install.packages("forecast") # install packages &amp;amp;amp;amp;amp;amp;quot;forecast&amp;amp;amp;amp;amp;amp;quot; (if not available)
library(forecast) # load the forecast package to use &amp;amp;amp;amp;amp;amp;quot;ses&amp;amp;amp;amp;amp;amp;quot; function

# use ses function to calculate exponential smoothing wits specified alpha
fit1 &amp;amp;amp;amp;amp;amp;lt;- ses(chin.ts, alpha=0.2, initial=&amp;amp;amp;amp;amp;amp;quot;simple&amp;amp;amp;amp;amp;amp;quot;, h=3) # ses = simple exponetial smoothing
fit2 &amp;amp;amp;amp;amp;amp;lt;- ses(chin.ts, alpha=0.6, initial=&amp;amp;amp;amp;amp;amp;quot;simple&amp;amp;amp;amp;amp;amp;quot;, h=3)
fit3 &amp;amp;amp;amp;amp;amp;lt;- ses(chin.ts, alpha=0.8, initial=&amp;amp;amp;amp;amp;amp;quot;simple&amp;amp;amp;amp;amp;amp;quot;,h=3)

# plot the calculated exponential smoothing with 3 alpha value in a single plot
plot(fit1, plot.conf=FALSE, ylab=&amp;amp;amp;amp;amp;amp;quot;Chinese Tourist Arrival to Thailand&amp;amp;amp;amp;amp;amp;quot;,
xlab=&amp;amp;amp;amp;amp;amp;quot;Year&amp;amp;amp;amp;amp;amp;quot;, main=&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;quot;, fcol=&amp;amp;amp;amp;amp;amp;quot;white&amp;amp;amp;amp;amp;amp;quot;, type=&amp;amp;amp;amp;amp;amp;quot;o&amp;amp;amp;amp;amp;amp;quot;)
lines(fitted(fit1), col=&amp;amp;amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;amp;amp;quot;, type=&amp;amp;amp;amp;amp;amp;quot;o&amp;amp;amp;amp;amp;amp;quot;) # add line
lines(fitted(fit2), col=&amp;amp;amp;amp;amp;amp;quot;red&amp;amp;amp;amp;amp;amp;quot;, type=&amp;amp;amp;amp;amp;amp;quot;o&amp;amp;amp;amp;amp;amp;quot;) # add line
lines(fitted(fit3), col=&amp;amp;amp;amp;amp;amp;quot;green&amp;amp;amp;amp;amp;amp;quot;, type=&amp;amp;amp;amp;amp;amp;quot;o&amp;amp;amp;amp;amp;amp;quot;) # add line

lines(fit1$mean, col=&amp;amp;amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;amp;amp;quot;, type=&amp;amp;amp;amp;amp;amp;quot;o&amp;amp;amp;amp;amp;amp;quot;) # add mean
lines(fit2$mean, col=&amp;amp;amp;amp;amp;amp;quot;red&amp;amp;amp;amp;amp;amp;quot;, type=&amp;amp;amp;amp;amp;amp;quot;o&amp;amp;amp;amp;amp;amp;quot;) # add mean
lines(fit3$mean, col=&amp;amp;amp;amp;amp;amp;quot;green&amp;amp;amp;amp;amp;amp;quot;, type=&amp;amp;amp;amp;amp;amp;quot;o&amp;amp;amp;amp;amp;amp;quot;) # add mean

# add legend of the plottoed lines
legend(&amp;amp;amp;amp;amp;amp;quot;topleft&amp;amp;amp;amp;amp;amp;quot;,lty=1, col=c(1,&amp;amp;amp;amp;amp;amp;quot;blue&amp;amp;amp;amp;amp;amp;quot;,&amp;amp;amp;amp;amp;amp;quot;red&amp;amp;amp;amp;amp;amp;quot;,&amp;amp;amp;amp;amp;amp;quot;green&amp;amp;amp;amp;amp;amp;quot;),
c(&amp;amp;amp;amp;amp;amp;quot;data&amp;amp;amp;amp;amp;amp;quot;, expression(alpha == 0.2), expression(alpha == 0.6),
expression(alpha == 0.8)),pch=1)

# Time series decomposition
chin.decmp.add &amp;amp;amp;amp;amp;amp;lt;- decompose(chin.ts, type = c(&amp;amp;amp;amp;amp;amp;quot;additive&amp;amp;amp;amp;amp;amp;quot;)) # additive model

chin.decmp.mul &amp;amp;amp;amp;amp;amp;lt;- decompose(chin.ts, type = c(&amp;amp;amp;amp;amp;amp;quot;multiplicative&amp;amp;amp;amp;amp;amp;quot;)) # multiplicative model

Test 1: Descriptive analysis (pdf)

4. Correlation and Regression Model

Screen Shot 2016-06-20 at 09.43.01

5. Data Visulisation

In this era of data-driven economy, there are tons of data floating around the Internet. One of the key things is to develop a reader-friendly data visualisation (Data Viz) to present complicated data in an easy to digest way.

One of the exampole is the motion bubble chart by Hans Rosling. His TED talk below is aphenomenon. Please have a look.



R Code

Resources for R Programming

 Online Courses

Additional readings

One Comment Post a comment
  1. I have noticed you don’t monetize your page, don’t waste your traffic, you can earn additional bucks every month
    because you’ve got hi quality content. If you want to know how to make extra money, search for: Boorfe’s tips best
    adsense alternative

    December 23, 2017

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: