Introductory Econometrics: Assignment
TA. Min-Chi Chung (d`rRrRᾣᾣR)
Department of Economics
National Taiwan University
• Deadline: ᾣr/r` `ᾣ:rᾣ a.m., we will discuss assignment in class, so please avoid late
submission that will not be graded.
• Don’t just give me an answer, show your process.
• In computer exercises, all of short answers, code and screenshots of the results are
required, click me for the example.
• If you have any question, please contact me.
Problem Set
`. (`ᾣ>) Determine the types of following data, just answer cross-sectional, time series
or panel data. Ris question does not require a process.
(a) (r>) Re GDP of Taiwan from `g`` to rᾣrs. `
(b) (r>) rᾣr` Adult Education Survey in Taiwan. r
(c) (r>) Re closed price of S&P`ᾣᾣ from Jan,r rᾣrᾣ to Feb,`· rᾣr`. s
(d) (r>) Expenditure on primary education (> of government expenditure on education) from `g·ᾣ to rᾣrᾣ for all country. G
(e) (r>) Re exchange rate of NTD, JPY, HKD and BGP to USD on Jan,rr rᾣr`. `
`
Available from National Statistics, R.O.C. (Taiwan).
Available from Survey Research data archive (SRDA).
s
Available from Yahoo ąnance.
G
Available from World Development Indicators (WDI).
`
Available from 中央結絕給統經弟基.
r
`
Introductory Econometrics: Assignment
TA. Min-Chi Chung (d`rRrRᾣᾣR)
Department of Economics
National Taiwan University
r. (sᾣ>) Suppose that you are asked to conduct a study to determine whether smaller
class sizes lead to improved student performance of fourth graders.
(a) (`ᾣ>) If you could conduct any experiment you want, what would you do?
(b) (`ᾣ>) More realistically, suppose you can collect observational data on several
thousand fourth graders in a given state. You can obtain the size of their fourthgrade class and a standardized test score taken at the end of fourth grade. Why
might you expect a negative correlation between class size and test score?
(c) (`ᾣ>) Would a negative correlation necessarily show that smaller class sizes
cause better performance? Explain.
s. (sᾣ>) Given the join p.d.f. of X, Y is
f XY (x, y) = `, ⌐x < y < x, ᾣ < x < `
answer the following questions.
(a) (`ᾣ>) Are X and Y statistically independent? Why or why not?
(b) (`ᾣ>) Are X and Y mean independent? Why or why not?
(c) (`ᾣ>) Are X and Y uncorrelated? Why or why not?
G. (sᾣ>) (Computer Exercise)
(a) (`ᾣ>) Make sure you have a so«ware that you can use to run statistical analysis.
If you don’t have yet, you can try to use Stata in the SS`ᾣ`, or download R.
(b) (`>) Use gpar.dta to plot the histogram of colgpa (GPA a«er fall semester).
(c) (`>) Use gpar.dta to plot the scatter plot of colgpa (GPA a«er fall semester)
and hsperc (high school percentile, from top).
(d) (`>) Use GDP.csv to plot the time series of GDP .
r
Introductory Econometrics: Assignment
TA. Min-Chi Chung (d`rRrRᾣᾣR)
Department of Economics
National Taiwan University
(e) (`>) Use GDP.csv to plot the time series of GDP growth rate.
Note: you can use the formula
GDP growth ratet =
s
GDPt ⌐ GDPt⌐`
∗ `ᾣᾣ>.
GDPt⌐`
Introductory Econometrics: Assignment
TA. Min-Chi Chung (d`rRrRᾣᾣR)
Department of Economics
National Taiwan University
參結絕給
`a. Time series data.
`b. Cross-sectional data.
`c. Time series data.
`d. Panel data.
`e. Cross-sectional data.
ra. Ideally, we could randomly assign students to classes of diĄerent sizes. Rat is, each
student is assigned a diĄerent class size without regard to any student characteristics such
as ability and family background.
rb. Because children from more aąuent families might be more likely to attend schools
with smaller class sizes, and aąuent children generally might score better on standardized tests. Another possibility is that, within a school, a principal might assign the better
students to smaller classes.
rc. No, there are some potential for confounding factors, such as r(b), ąnding a negative
correlation would not be strong evidence that smaller class sizes actually lead to better
performance.
sa. No, compute the marginal p.d.f. of X and Y are
f X (x) = ⩀
x
⌐x
`dy = rx, ᾣ < x < `
⌜
`
⌜
⌜
⌜
⌜ ⊍⌐y `dx = ` + y, ⌐` < y ≤ ᾣ
fY (y) = ⌝
⌜
`
⌜
⌜
`dx = ` ⌐ y, ᾣ < y < `
⌜
⌝ ⊍y
= ` ⌐ ⌝y⌝, ⌐` < y < `
G
Introductory Econometrics: Assignment
TA. Min-Chi Chung (d`rRrRᾣᾣR)
Department of Economics
National Taiwan University
the conditional p.d.f.
fY⌜X=x (y) =
`
, ⌐x < y < x, ᾣ < x < `
rx
depends on X, X and Y are not statistically independent.
sb. Yes,
`
dy = ᾣ
rx
⌐x
`
`
`
E(X⌝Y) = ⩀ x ⋊ dx =
rx
r
ᾣ
E(Y⌝X) = ⩀
x
y⋊
so X and Y are mean independent.
sc. Yes,
E(XY) = E[XE(Y⌝X)] = E(ᾣ) = ᾣ
E(Y) = E[E(Y⌝X)] = E(ᾣ) = ᾣ
Cov(X, Y) = E(XY) ⌐ E(X)E(Y) = ᾣ ⌐ ᾣ = ᾣ
Corr(X, Y) = ⌝
so X and Y are uncorrelated.
ᾣ
⌝
=ᾣ
Var(X) Var(Y)
Ga. Skip.
Gb. As following.
`
Introductory Econometrics: Assignment
TA. Min-Chi Chung (d`rRrRᾣᾣR)
Department of Economics
National Taiwan University
600
0
200
400
Frequency
800
1000
1200
Histogram of colgpa
0
1
2
3
4
3
4
colgpa
40
0
20
hsperc
60
80
Gc. As following.
0
1
2
colgpa
Gd. As following.
S
Introductory Econometrics: Assignment
TA. Min-Chi Chung (d`rRrRᾣᾣR)
1.0e+07
0.0e+00
5.0e+06
GDP
1.5e+07
2.0e+07
Department of Economics
National Taiwan University
1950
1960
1970
1980
1990
2000
2010
2020
1990
2000
2010
2020
year
20
10
0
GDP growth rate
30
40
Ge. As following.
1950
1960
1970
1980
year
ś
Introductory Econometrics: Assignment
TA. Min-Chi Chung (d`rRrRᾣᾣR)
Department of Economics
National Taiwan University
R code
library("haven")
# 4b
rm(list=ls())
data<-read_dta("gpa2.dta")
attach(data)
hist(colgpa)
# 4c
plot(colgpa,hsperc)
# 4d
rm(list=ls())
data <-read.csv("GDP.csv")
attach(data)
plot(year, GDP, type = ’l’)
# 4e
gdp_growth <- c(NA, diff(GDP)) / c(NA, GDP[1:75]) *100
plot(year, gdp_growth, type = ’l’, ylab = ’GDP growth rate’)
·