Finish the HW1.with quailty work
Econ 5420: Cross Section: Introduction
Prof. Jason Blevins
Department of Economics
The Ohio State University
What is Econometrics?
Model ⇐⇒ Econometrics ⇐⇒ Data
Figure 1: What is econometrics?
• Literally “economic measurement”
• Quantitative analysis of economic problems
• Application of statistical methods to connect theoretical
economic models to data
• Bridges abstract economic theory and real-world human
economic activity
• Notion of a “true model”
Relevance
• Academic research • Every field of economics
• With the exception of pure theory
• Government • Procurement auctions (e.g., FCC spectrum auctions)
• Assignment of scarce resources (e.g., timber and spectrum
auctions)
• Antitrust
• Environmental regulation
• Business • Estimate demand for a new product
• Forecasting sales
• Pricing financial assets
• Search engine advertisements
Non-ideal data
• Traditional statistics: controlled experiments
• Economists rarely have this luxury
• Much of econometrics focuses on statistical analysis of
data under the non-ideal circumstances inherent in
measuring economic interactions.
Quote: Ragnar Frisch
[T]here are several aspects of the quantitative
approach to economics, and no single one of these
aspects, taken by itself, should be confounded with
econometrics. Thus, econometrics is by no means
the same as economic statistics. Nor is it identical
with what we call general economic theory, although
a considerable portion of this theory has a definitely
quantitative character. Nor should econometrics be
taken as synonomous with the application of
mathematics to economics. . . . It is the unification of
all three that is powerful. And it is this unification that
constitutes econometrics.
–Frisch (1933)
Roles of Econometrics
In light of these definitions, it is clear that econometrics is used
for:
1. quantifying economic relationships (estimation),
2. testing economic theories, and
3. prediction and forecasting.
Demand Example
Example
Let Q denote the quantity demanded of a particular good. We
expect that Q should depend on P, the price of the good itself,
Ps, the price of a substitute good, and Yd, disposable income.
Without saying more about the specific relationships between
these variables, we can represent this notion using the abstract
functional relationship
Q = f(P, Ps, Yd).
Typically, we would expect demand (Q) to decrease with P
and increase with Ps.
Examples of the Roles of Econometrics
Examples of the three roles applied to the demand model
Q = f(P, Ps, Yd):
1. Quantifying economic relationships: In a linear model
Q = β1 + β2P + β3Ps + β4Yd,
what are the values of the β1, β2, β3, and β4?
2. Testing economic theories: Is the good a normal good?
3. Prediction and forecasting: How many units would be
demanded, given hypothetical values of prices and
income?
Estimation: Quantifying Uncertainty
Q
Yd
(a) Small sample
Q
Yd
(b) Large sample
Q
Yd
(c) Low variance
Figure 2: Statistical significance.
A Note on Causality
• Correlation does not imply causation!
• Suppose we observe that when large numbers of people
carry umbrellas to work it tends to rain.
• Obviously, carrying umbrellas do not cause it to rain!
• This is of course just a correlation, and the causation runs
in the opposite direction.
• For the purposes of prediction, perhaps the number of
umbrellas is a good predictor of rain, but for interpretation
of the underlying process it is nonsensical.
Another Note on Causality
Example
A study of traffic accidents due to alcohol examined police
reports of traffic accidents. For each, researchers recorded
whether the driver had consumed alcohol and whether or not
the report noted an empty beer container in the vehicle.
Statement A: A recent study has found that drinking beer while
driving may lead to increased risk of an accident.
Statement B: A recent study has found that empty beer
containers in cars may lead to increased risk of an accident.
Econometric Data
There are three basic types of econometric data:
1. Cross-sectional data: observations on different individual
units (e.g., people or firms) with no natural ordering.
2. Time series data: observations at different points in time
(e.g., monthly or yearly) with a natural ordering (time).
3. Panel data: a mixture of time series and cross sectional
data consisting of observations on multiple individuals
(unordered) at different points in time (ordered).
Cross-Sectional Data
Example
A cross-sectional dataset on different students including age,
GPA, and hours studied per week:
Student Age GPA Hours
1 20 3.4 10
2 21 3.1 5
3 19 3.9 12 ...
... ...
...
Time Series Data: Example
Example
A time series dataset consisting of semester-by-semester
observations on a single student:
Semester Age GPA Hours
Fall 2013 18 3.3 7
Spring 2014 18 3.8 5
Fall 2014 19 3.5 12 ...
... ...
...
Panel Data: Example
Example
A panel dataset with observations on multiple students across
multiple semesters:
Student Semester Age GPA Hours
1 Fall 2013 18 3.3 7
1 Spring 2014 18 3.8 5
1 Fall 2014 19 3.5 12 ...
... ...
... ...
2 Fall 2013 20 3.1 10
2 Spring 2014 20 2.9 10
2 Fall 2014 21 3.4 18 ...
... ...
... ...
Mean, Variance, and Standard Deviation
• Three important features of random variables: mean,
variance, and standard deviation.
• Referred to as “moments” of a distribution.
• Forumla depends on whether the distribution is discrete
(sum) or continuous (integral).
Expected Value
The expected value or mean of a discrete random variable is
the sum of all possible outcomes weighted by the probability
that each outcome occurs.
• Discrete random variable Z takes on a countable number
of outcomes.
• Let k denote the number of outcomes and z1, z2, . . . , zk are denote the values of the outcomes.
• Let P(z1), P(z2), . . . , P(zk) denote the probabilities
associated with each outcome.
• The expected value of Z, denoted E[Z] or µ is
µ = E[Z] = k∑ i=1
P(zi)zi = P(z1)z1 + · · · + P(zk)zk
Expected Value
Example
An individual makes a bet with the possibility of losing $1.00,
breaking even, winning $3.00, or winning $5.00. Let Z be a
random variable representing the winnings.
Outcome -$1.00 $0.00 $3.00 $5.00
Probability 0.30 0.40 0.20 0.10
The mean outcome is:
µ = E[Z] = (0.3 × −1) + (0.4 × 0) + (0.2 × 3) + (0.1 × 5) = −0.3 + 0.6 + 0.5 = 0.8
Therefore, the expected payoff for this bet is $0.80.
Variance
The variance of a discrete random variable Z, denoted Var(Z)
or σ2, is a measure of the variability of the distribution and is
defined as
σ2 = Var[Z] = E[(Z − µ)2] = k∑ i=1
P(zi)(zi − µ)2.
The variance is the expected value of (Z − µ)2 which is the anticipated average value of the squared deviations of Z from
the mean.
Variance: Example
Example
Returning to the example, even though the odds are favorable
one might also be concerned about the possibility of extreme
outcomes. The variance of the winnings is
σ2 = [0.3 × (−1 − 0.8)2] + [0.4 × (0 − 0.8)2] + [0.2 × (3 − 0.8)2] + [0.1 × (5 − 0.8)2]
= [0.3 × (−1.8)2] + [0.4 × (−0.8)2] + [0.2 × (2.2)2] + [0.1 × (4.2)2]
= [0.3 × 3.24] + [0.4 × 0.64] + [0.2 × 4.84] + [0.1 × 17.64] = 0.972 + 0.256 + 0.968 + 1.764
= 3.96.
Standard Deviation
The standard deviation, denoted σ, is the square root of the
variance.
Example
In our example, the variance was σ2 = 3.96 so the standard
deviation is
σ = √ 3.96 ≈ 1.99
Sample Statistics
In contrast to the population mean, the sample average or
sample mean is a sum over n sampled values (called
realizations) of a random variable where all of the weights are
all equal to 1/n. Let {Z1, Z2, . . . , Zn} denote a sample of size n from the distribution of Z. The sample average of
{Z1, Z2, . . . , Zn} is
Z̄ = 1
n
n∑ i=1
Zi = 1
n Z1 + · · · +
1
n Zn.
The sample variance is defined similarly:
s2 = 1
n
n∑ i=1
(Zi − Z̄)2.
Normal Distribution
• Mean, variance, and standard deviation are can be
illustrated intuitively with the normal distribution.
• Write N(µ, σ2) to denote the normal distribution with
mean µ and variance σ2.
• The standard deviation is defined as the square root of the
variance, σ in this case.
Normal Distribtion
0.00
0.04
0.09
0.14
0.18
0.22
0.27
0.31
0.36
0.40
0.45
-9.0 -7.2 -5.4 -3.6 -1.8 0.0 1.8 3.6 5.4 7.2 9.0
P ro
b a b ili
ty d
e n si
ty
x
Figure 3: N(0, 1)
Normal Distribtion
0.00
0.04
0.09
0.14
0.18
0.22
0.27
0.31
0.36
0.40
0.45
-9.0 -7.2 -5.4 -3.6 -1.8 0.0 1.8 3.6 5.4 7.2 9.0
P ro
b a b ili
ty d
e n si
ty
x
Figure 4: N(1, 2)
Simple Regression
• Ordinary Least Squares (OLS) with a single independent
variable.
• The theoretical model of interest is the linear model
Yi = β0 + β1Xi + ui.
• From this equation, we seek to use the information
contained in a dataset of observations (Xi, Yi) to estimate
the values of β0 and β1, which we call β̂1 and β̂2.
• The fitted values are
Ŷi = β̂0 + β̂1Xi
• The residuals are the differences between the fitted values
Ŷi and the observed values Yi:
ûi ≡ Yi − Ŷi.
The Geometry of Simple Regression
0
Y
XX1 X2
Y2
Ŷ2
Ŷ1
Y1
û2
û1
Figure 5: Estimated regression line and residuals
Simple Regression
• We need to formally define our loss function, the criteria
by which we determine whether the fit is good or not.
• OLS is founded on minimizing the sum of squared
residuals (SSR), defined as
SSR = n∑ i=1
û2i = û 2 1 + û
2 2 + · · · + û
2 n,
where n is the sample size.
• OLS estimates of β0 and β1 are defined to be the values of
β̂0 and β̂1 which, when plugged into the estimated
regression equation, minimize the SSR.
• Note that different samples (of the same size) yield
different estimates.
Why Ordinary Least Squares?
OLS is used so often for several reasons.
1. It is very straightforward to implement, both by hand and
computationally, and it is simple to work with theoretically.
2. The criteria of minimizing the squared residuals is intuitive.
3. Other nice properties: the regression line passes through
the means of X and Y, (X̄, Ȳ), the sum of the residuals is
zero, etc.
Simple Regression: Interpretation
In the regression line
Yi = β̂0 + β̂1Xi,
the coefficient on Xi represents the amount by which we
predict Yi will increase when Xi increases by one unit.
Simple Regression: Interpretation
Example
Let Yi be an individual i’s annual demand for housing in dollars
and let Xi be individual i’s annual income, also measured in
dollars.
Then β̂1 is the number of additional dollars individual i is
predicted to spend on housing when income increases by one
dollar.
The intercept, β̂0, is an individual’s predicted expenditure on
housing when income is zero.
Anscombe's Quartet: A Cautionary Tale
4 6 8 10 12 14 16 18
4
6
8
10
12
x1
y 1
4 6 8 10 12 14 16 18
4
6
8
10
12
x2
y 2
4 6 8 10 12 14 16 18
4
6
8
10
12
x3
y 3
4 6 8 10 12 14 16 18
4
6
8
10
12
x4
y 4
OLS Review: Sum of the Residuals is Zero
To see that the residuals sum to zero, we can look at the
average of the residuals. If the average is zero, so is the sum.
1
n
n∑ i=1
ûi = 1
n
n∑ i=1
( Yi − β̂0 − β̂1Xi
) =
1
n
n∑ i=1
Yi − β̂0 − β̂1 1
n
n∑ i=1
Xi
= Ȳ − β̂0 − β̂1X̄.
But recall that β̂0 = Ȳ − β̂1X̄, and so
1
n
n∑ i=1
ûi = Ȳ − β̂0 − β̂1X̄.
= Ȳ − (Ȳ − β̂1X̄) − β̂1X̄ = 0.
OLS Review: Fitted Value at Mean
Show that the regression line passes through the point (X̄, Ȳ).
We can evaluate the regression line at the point X̄ and show
that the fitted value is indeed Ȳ.
Substituting for β̂0 gives:
Ŷ = β̂0 + β̂1X
= (Ȳ − β̂1X̄) + β̂1X.
Then evaluating at the point X = X̄ gives:
Ŷ = (Ȳ − β̂1X̄) + β̂1X̄ = Ȳ.
OLS Review: Average of Predicted Values
Another property is that the average of the predicted values Ŷi equals the average of the observations Yi:
1
n
n∑ i=1
Ŷi = 1
n
n∑ i=1
(β̂0 − β̂1Xi)
= β̂0 + β̂1X̄
= (Ȳ − β̂1X̄) + β̂1X̄ = Ȳ.
References
Frisch, R. (1933). Editor’s note. Econometrica 1, 1–4.
- Introduction
- What is Econometrics?
- Some Quotes
- Causality
- Econometric Data
- Mathematical and Background
- Mean, Variance, and Standard Deviation
- Sample Statistics
- Simple Regression
- OLS Review