0% found this document useful (0 votes)
2 views5 pages

First Assignment

The document outlines a homework assignment focused on nonlinear econometrics for finance, specifically analyzing household finance and medical costs using linear regression techniques in Python. It includes various problems that require generating histograms, performing regression analysis, testing hypotheses, and making predictions based on given data. Additionally, it covers the review of methods related to sample variance and its properties, including bias, consistency, and asymptotic normality.

Uploaded by

aurarolee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

First Assignment

The document outlines a homework assignment focused on nonlinear econometrics for finance, specifically analyzing household finance and medical costs using linear regression techniques in Python. It includes various problems that require generating histograms, performing regression analysis, testing hypotheses, and making predictions based on given data. Additionally, it covers the review of methods related to sample variance and its properties, including bias, consistency, and asymptotic normality.

Uploaded by

aurarolee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Nonlinear econometrics for finance

HOMEWORK 1
(Review of linear econometrics and review of
methods)

Problem 1 (Linear econometrics). (60 points) Household finance is a


growing field in finance. Rising health costs are not just impacting house-
holds’ finances, they are affecting an array of decisions, including the decision
to change (or retire from) an occupation which provides favorable health in-
surance subsidies. For a cross section of individuals, the file “insurance.csv”
provides the following information:
• age: age of primary beneficiary of health insurance
• sex: gender of primary beneficiary of health insurance
• bmi : this is a measure of a person’s weight relative to height. It is
defined as bmi = kg/m2 , where kg is the person’s weight and m2 is the
person’s height measured in squared meters. A bmi between 18.5 and
24.9 is considered healthy. More would be considered “overweight”.
• children: number of children covered by health insurance
• smoker: whether the primary beneficiary is a smoker or not
• region: the primary beneficiary’s residential area in the US (northeast,
southeast, northwest, southwest)
• charges: medical costs billed to health insurance.
Given this information, you need to perform linear regression in Python to
understand the drivers of medical costs.

1
(1) (3 points) Generate an histogram of the medical costs and compute de-
scriptive statistics (mean, median, standard deviation, minimum, max-
imum). Is the distribution symmetric? Why or why not, in your view?

(2) (3 points) Take a logarithmic transformation of the medical costs. Plot


the histogram of the log-costs. What do you notice now? How would
you explain the change?

Begin by excluding all categorical variables (sex, smoker and region).

(3) (4 points) Run a regression of the log-costs on the non-categorical ex-


planatory variables:

log(costi ) = θ0 + θ1 agei + θ2 bmii + θ3 childreni + εi ,

where εi is an error term.

(4) (3 points) Give an economic interpretation of the estimated coefficients


in the regression above. What does the model say about the determi-
nants of medical costs?

(5) (4 points) We want to test whether the coefficient θ2 for bmi is statis-
tically significant. Test the hypothesis using the relevant test statistic.
Does bmi have more or less explanatory power than age?

(6) (3 points) We want to test whether the coefficient θ2 for bmi is statis-
tically significant. Test the hypothesis using the relevant p-value.

(7) (5 points) Test the single linear restriction θ1 = 3θ2 using the relevant
test statistic.

(8) (3 points) Test the single linear restriction θ1 = 3θ2 using the relevant
p-value.

(9) (5 points) Test the multiple linear restriction θ1 = 0.04 and θ2 = 0


using the relevant test statistic.

(10) (3 points) Test the multiple linear restriction θ1 = 0.04 and θ2 = 0


using the relevant p-value.

2
(11) (4 points) Using the estimated model, predict medical costs for a 50
year-old person with bmi = 36 and 4 children. Is the prediction lower or
higher than the mean of the distribution of the medical costs? (Recall
that the regression gives you a prediction for the log of the medical
costs (say, log(y)) not for the medical costs (say, y). Hence, after you
find the prediction for the log of the medical costs, you need to make
a transformation to find a prediction for the medical costs themselves.
Hint: if log(y) is normal, y is lognormal. What is E(y) for a log normal
random variable? )
Now, take the categorical variables into account using dummy variables
(https://en.wikipedia.org/wiki/Dummy_variable_(statistics)).
(12) (3 points) How much more (or less) do males spend relative to females
(controlling for all other variables)?
(13) (3 points) How much more (or less) do smokers spend relative to non
smokers (controlling for all other variables)?
(14) (3 points) In which region are medical costs higher (controlling for all
other variables)?
(15) (3 points) What is the difference in medical costs between the northeast
and the southwest (controlling for all other variables)?
(16) (4 points) Are the coefficients associated with the dummies individually
statistically significant?
(17) (4 points) Using your model, predict medical costs for a 50 year-old
male smoker with bmi = 36 who lives in the southwest and has 4
children.

Problem 2 (Review of methods). (30 points) Assume an iid sample


{x1 , x2 , ..., xT } from some distribution with expected value µ and variance σ 2 .
A natural estimator for the true variance (i.e., σ 2 ) of the random PTvariable
2 1
which generates the data is the sample variance, namely sx = T t=1 (xt −
X)2 , where X defines the sample mean, i.e., X = T1 Tt=1 xt .
P

First, let us focus on the finite-T (or finite-sample) properties of s2x :

3
(1) (4 points) Show that the sample variance s2x is biased for the true
variance σ 2 .
(2) (3 points) How would you correct the bias?
(3) (3 points) What is the bias of the infeasible variance estimator s2x,inf =
1
PT 2
T t=1 (xt − µ) . Why am I calling this estimator infeasible?

Now, let us turn to the large-T (or infinite-sample or asymptotic) properties


of s2x . Write the following:
T
1X
s2x = (xt − X)2
T t=1
T
1X
= ((xt − µ) − (X − µ))2
T t=1
T T
1X 1X
= (xt − µ)2 − 2(X − µ) (xt − µ) + (X − µ)2 (1)
T t=1 T t=1 | {z }
| {z } | {z } (c)
(a) (b)

Now, subtract σ 2 from the


√ left-hand side and from the right-hand side of Eq.
(1) and standardize by T to obtain:
T
√ √
PT 2 2
2 2 t=1 ((xt − µ) − σ ) 1 X
T (sx − σ ) = √ − 2(X − µ) √ (xt − µ) + T (X − µ)2
{zT T t=1 | {z }
| } | {z } (c∗ )
(a∗ ) (b∗ )

(2)
(4) (4 points) Show that s2x is consistent for σ 2 by applying the LLN to
(a), (b) and (c) in Eq (1).

(5) (4 points) Show that T (s2x − σ 2 ) is asymptotically normal by ap-
plying the LLN, the CLT and Slutsky’s theorem to (a∗ ), (b∗ ) and (c∗ )
in Eq. (2).
Notice that consistency is a statement about sample averages, like s2x , con-
verging (as T → ∞) to expected values. Asymptotic normality is a statement

about demeaned (by σ 2 , in our example)
√ and standardized (by T , in
our example) sample averages, like T (s2x − σ 2 ), converging (as T → ∞) to
a mean-zero normal distribution.

4
(6) (6 points) Use my sample Python codes from Lecture 1 to write a code
which shows consistency of s2x . You should draw your observations from
a random variable which is neither exponential nor normal.

(7) (6 points) Use my sample Python codes√from Lecture 1 to write a code


which shows asymptotic normality of T (s2x − σ 2 ). You should draw
your observations from a random variable which is neither exponential
nor normal.

You might also like