# ECON 103 Problem Set Worksheet

Description

1 attachmentsSlide 1 of 1attachment_1attachment_1.slider-slide > img { width: 100%; display: block; }
.slider-slide > img:focus { margin: auto; }

Unformatted Attachment Preview

Problem_Set_3_Econ_103
May 3, 2022
1
ECON 103 – Problem Set 3
This problem set is devoted to the study the properties of the simple regression model discussed in
Chapter~4.
You will need the following datasets from the course website or the below link (which have uploaded
for you):
1. food
2. wa_wheat
You can review how to load a dataset in R by checking the Section 0 of the Jupiter Notebook called
Week_5_Econ_103_Lab_Class 2021.ipynb
1.1
Due: May 3, 2022
Theory questions
1.2
Question 1 (4.2, Page 158)
Consider the following estimated regression equation (standard errors in parentheses):
y? = 10.00 + 1.00x
(se) (1.23) (0.117)
R2 = 0.756
According to the regression, we hqave that b?1 = 10.00 and b?2 = 1.00 Rewrite the estimates that
would result if:
(a) All values of x were divided by 20 before estimation.
(b) All values of y were multiplied by 50 before estimation.
(c) All values of y and x were multiplied by 20 before estimation.
(a)
(b)
(c)
1
: # Use this R cell if you want to make calculations
hi
[ ]:
1.3
Data analysis questions
1.4
Question 2
Consider the data set of food expenditure and income used in class. Let y denotes Food expenditure
and x denotes the family weekly income. Do the following tasks:
(a) Evaluate the sample correlation between x and y, that is, rxy and compute the
2 . (You can obtain the correlation besquared value of this correlation, that is, rxy
tween variables by using the command cor(food\$food_exp, food\$income). Also
check Section 3 of the the Notebook Week_5_Econ_103_Lab_Class 2021.ipynb)
(b) Evaluate the linear regression Y = ?1 + ?2 · X + ? and the linear regression X =
?1 + ?2 · Y + ?. Are the ?2 estimates the same? Are the R2 the same? How does
2 ? (check Section 3 of
the R2 compare with the squared value of the correlation rxy
the the Notebook Week_5_Econ_103_Lab_Class 2021.ipynb)
(c) Evaluate the sample standard deviation of x and y, that is, ?x , ?y and
generate the transformed variables y? = y/?y and x? = x/?x . (You
can obtain the standard errors by using the following commands sy Insert Cell Below
Note also that you can change the description of the cell using the drop-down?
,?menu at the top-right corder of the cell.
# If you attemt thie question before question 3, then use the following?
# The following commands are useful to load the data
#library(PoEdata) # Load Library that contains the data set
#data(food)
# Data set called wa_wheat is loaded
# Note that these commands do not generate any output
# The following commands are useful to show some basic description of the data
#names(food)
# displays the names of the variables in the data set
# Displays the first 10 rows of data
#summary(food)
# Basic Statistical description of the data
1.6
Question 4 (q. 4.4, page 158)
The general manager of an engineering firm wants to know whether a technical artists experience
influences the quality of his or her work. A random sample of 50 artists is selected and their years of
work experience and quality rating (as assessed by their supervisors) are recorded. Work experience
(EXP ER) is measured in years and quality rating (RAT IN G) takes a value in the interval one
to four, with 4 = very good and 1 = very poor. Two models are estimated by least squares. The
estimates and standard errors are
4

Model 1: RAT
IN G = 3.446 ? 0.001459 (EXP ER ? 35)2 ; N = 50
(se)
(0.0375)
(0.0000786)

Model 2: RAT
IN G = 1.4276 + 0.5343 log(EXP ER); N = 50
(se)
(0.1333)
(0.04333)
In this question you do not need to evaluate a regression, but simply use the information on the
regressions presented above.
(a) For each model, predict the rating of a worker with 10 years of experience.
(To answer this question, you may want to see Section 8 of the notebook
Week_5_Econ_103_Lab_Class 2021.ipynb)
(b) Using each model, estimate the expected marginal effect of another year of
experience on the expected worker rating for a worker with 10 years experience. (To answer this question, you may want to see Section 8 of the notebook
Week_5_Econ_103_Lab_Class 2021.ipynb)
(c) Using each model, construct a 95% interval estimate for the average marginal
effect found in (c). To answer this question, you will need to compute the estimated standard erro of your marginal effect, which turns out to be a simple
linear transformation of the estimator b2 . You will also need to compute the critical value tc . You may find it usefull to check section 1 of the the notebook
Week_5_Econ_103_Lab_Class 2021.ipynb. The section computes the confidence
interval for ? = c1 b1 + c2 b2 where c1 = 1 and c2 = 20. This question is simpler as
the marginal effect is linear transformation of b2 only.
(a)
(b)
(c)
: #
#
#
#
#
Use this R cell for your regressions
To add a code cell, simply click on:
Insert-> Insert Cell Below
Note also that you can change the description of the cell using the drop-down?
,?menu at the top-right corder of the cell.
1.7
Question 5 (q. 4.8, page 159)
The first three columns in the file wa_wheat contain observations on wheat yield in the Western
Australian shires Northampton, Chapman Valley, and Mullewa, respectively. There are 48 annual
observations for the years 1950 – 1997. The name of the varibale that contains data on the crop
yields of the Chapman Valley Shire is called chapman. For the Chapman Valley Shire, consider
the four itens below:
The tasks performed in this exercise requires the commands discussed in the Notebook
Week_5_Econ_103_Lab_Class 2021.ipynb Please study the Notebook before attempting the question.
5
(a) This item consistis of three tasks where Y syands for crop yield of the Chapman Valley Shire: (a.1) Estimate the Linear model Y = ?1 + ?2 time + ? (a.2)
Plot the residuals of the regression (for commands, you can check Section 5
of Week_5_Econ_103_Lab_Class 2021.ipynb) (a.3) Test the normality of the
residuals using the Jarque-Bera test (for commands, you can check Section 5 of
Week_5_Econ_103_Lab_Class 2021.ipynb)
(b) This item consistis of three tasks in the same fashion as in the item (a): (b.1)
Estimate the Linear-log model Y = ?1 + ?2 log(time) + ? (b.2) Plot the residuals
of the regression (b.3) Test the normality of the residuals using the Jarque-Bera
test (For commands related to the estimation of the Linear-log model, see Section 4
of Week_5_Econ_103_Lab_Class 2021.ipynb. See Section 5 to use the command
jarque.bera.test(ehat) #(in package ‘tseries’) that performs the Jarquebera Test.)
(c) Taking into consideration (i) plots of the fitted equations, (ii) plots of the residuals,
(iii) error normality tests, and (iv) values for R2 , which equation do you think is
preferable? (This is a theoretical question, no code needed)
(a) You can simply show the code in the cell below
(b) You can simply show the code in the cell below
: #
#
#
#
#
To add a code cell, simply click on:
Insert-> Insert Cell Below
Note also that you can change the description of the cell using the drop-down?
,?menu at the top-right corder of the cell.
# The following commands are useful to load the data
library(PoEdata) # Load Library that contains the data set
data(wa_wheat)
# Data set called wa_wheat is loaded
# Note that these commands do not generate any output
# The following commands are useful to show some basic description of the data
names(wa_wheat)
# displays the names of the variables in the data set
# Displays the first 10 rows of data
summary(wa_wheat)
# Basic Statistical description of the data
library(tseries) # This command loads the lybrary tseries that has the?
,?Jarque-Bera Test
# See Section 5 of the Notebook Week_4_Econ_103_Lab_Class.ipynb for an example?
,?of Jarque-Bera test
# The Jarque-Bera test is given by:
#jarque.bera.test(e) # Note that the variable “e” in the test denotes the?
,?residuals of a regression
1. northampton 2. chapman 3. mullewa 4. greenough 5. time
6
northampton
Min.
:0.3024
1st Qu.:0.9124
Median :1.0419
Mean
:1.1687
3rd Qu.:1.3023
Max.
:2.3161
time
Min.
: 1.00
1st Qu.:12.75
Median :24.50
Mean
:24.50
3rd Qu.:36.25
Max.
:48.00
chapman
Min.
:0.4167
1st Qu.:0.8586
Median :1.0133
Mean
:1.0724
3rd Qu.:1.2203
Max.
:2.0244
mullewa
Min.
:0.3965
1st Qu.:0.7871
Median :0.9706
Mean
:0.9841
3rd Qu.:1.1928
Max.
:1.7992
Registered S3 method overwritten by ‘quantmod’:
method
from
as.zoo.data.frame zoo
[ ]:
[ ]:
[ ]:
[ ]:
7
greenough
Min.
:0.4369
1st Qu.:0.9141
Median :1.0955
Mean
:1.1531
3rd Qu.:1.3285
Max.
:2.2353