Department of Economics – University of Victoria
Economics 345 “Applied Econometrics” (Summer 2019)
Assignment 4
Due on Monday, July 29
th, 4 pm in Department Dropbox
You are encouraged to work in groups on this assignment, but every student must submit their own
version of the assignment with their own write-up. Please indicate who was in your group by writing
the names and V-numbers of all group members at the top of your submitted assignment. Please
ensure you write legibly – an illegible assignment may lose marks.
Note that copying from existing solution manuals or solutions found online constitutes plagiarism
under the University’s guidelines.
Dummy Variables
1. (5 marks) The following equations were estimated using the data in “bwght”:
bwght i=4.682 - 0.005cigsi+0.155parityi+0.026malei+0.062whitei
(0.016) (0.0008) (0.006) (0.010) (0.012)
n=1,388, R2=0.045, R2=0.043
The variables’ definition can be found in the link:
http://fmwww.bc.edu/ec-p/data/wooldridge/bwght.des.
i (2 marks) Considering the second regression results, comment on the estimated effect and

Economics 345作业代做、代写R编程设计作业、代写R实验作业
statistical significance of fatheduc. (i.e., comment on the practical and statistical significance
of fatheduc’s partial effect separately)
ii (3 marks) Recall the content we learned in Chapter 4 (4-5f Testing General Linear
Restrictions). If two linear models are nested, it means that the restricted model is obtained
from the full model by setting some constraints on the parameters). In this question, the first
regression is the restricted model. It is obtained by restricting βmotheduc =0 and βfatheduc=0 in
the full model. Usually we can compare nested models with the F test to see whether the
restrictions are valid. In this questions, it means we need to compute the F statistic for joint
significance of motheduc and fatheduc by using the formula 4.37 in the textbook.
However, from the given information, why are you unable to compute the F statistic? What
would you have to do to compute the F statistic?
2. (11 marks) Use the data in “fertil2” to answer this question. The variables’ definition can be found
in the link: http://fmwww.bc.edu/ec-p/data/wooldridge/fertil2.des. Lab 9 provides the examples of
code that will be used in this question.
i (3 marks) Estimate the following model
2
and report the results with both usual and heteroskedasticity-robust standard errors. Are the
robust standard errors always bigger than the nonrobust ones?
ii (4 marks) Add the two religious dummy variables (protest, catholic). Suppose
heteroskedasticity is present in the equations from part (i) and (ii), can we use F-test here to
test whether the coefficients of protest and catholic are jointly significant? Why or why not?
If we cannot use F-test, what test should we apply? What is the p-value obtained from the
joint test for the coefficients of protest and catholic?
iii (3 marks) Now we move back to the regression in part (i). Choose one of the methods we
learned in lab 10 to test heteroskedasticity. Explain the method you choose. Make a
conclusion about whether heteroskedasticity is present in the equation for children.
iv (1 mark) If you find heteroskedasticity in part (iii), would you say the heteroskedasticity is
practically important?
3. (9 marks) Use the data in “loanapp” for this exercise. The binary variable to be explained
is approve, which is equal to one if a mortgage loan to an individual was approved. The key
explanatory variable is black, a dummy variable equal to one if the applicant was black. The other
applicants in the data set are white and Hispanic. The variables’ definition can be found in the link:
http://fmwww.bc.edu/ec-p/data/wooldridge/loanapp.des.
To test for discrimination in the mortgage loan market, a linear probability model can be used:
approvei
blacki+ control variables+ui
i (1 mark) If there is discrimination against blacks, and the appropriate factors have been
controlled for, what is the sign of β1
ii (3 marks) As controls, add the variables hrat, obrat, loanprc, unem, male, married, dep, sch,
cosign, chist, pubrec, mortlat1, mortlat2, vr, and black*obrat. Attach the estimated regression
results from R (no need to write down the regression equation). Is there evidence of
discrimination against blacks?
iii (2 marks) Using the model from part (ii), what is the effect of being black on the probability
of approval when obrat=32, which is roughly the mean value in the sample? Obtain a 95%
confidence interval for this effect. (Hint: replace black*obrat with black*(obrat-32). Run the
regression to obtain the estimated coefficient and the corresponding standard error of the new
interaction term to construct the confidence interval.)
iv (3 marks) Show the histogram of the predicted values of approve from the model in part (iii).
Are there any predicted values outside of the [0,1] range? Why should we be concerned about
this? (Hint: use hist(variablename) to plot the histogram. Replace variablename with the
name of the variable you generated to store the predicted values of approve.)
Time Series
4 (10 marks). Consider a simple model of a time series yt as a function of its past (using lagged
values):
3
is what we refer to as `stationary’ – its distribution does not change over time, i.e.
i Interpret the model – what does 1 capture?
ii Now consider the model including an additional variable.Is
the marginal effect of on the expected value of ????
still equal to
iii Consider again the model in (1). Suppose you are interested in forecasting ????
for periods t+1,
t+2,…. Show that the predicted deviation of yt from its expected value in period t+2 is
{Hint: first show that (1) can be written in deviations from equilibrium as
. Then consider the predicted deviation at t+1, t+2, t+3.... and use
substitution to show the required result.}
iv Suppose |1| < 1. What does your result from iii) tell you about the predicted deviation from
the model’s estimated equilibrium as the forecasting period increases?
5. (10 marks) Use the data set “consump” for this question.
i Estimate a simple regression model relating the logarithm of real per capita consumption
(log(c)) to the logarithm of real per capita disposable income (log(y)). Report the results in the
usual form (including the standard deviations, the number of observations and the values of R2 and R2). Interpret the equation and discuss statistical significance.
ii Add a lag of the logarithm of real per capita disposable income to the equation from part (i).
Report the results in the usual form. What do you conclude about adjustment lags in
consumption growth? (Hint: you can use “lylag<-log(dplyr::lag(consump$y,k=1))” to
generate a lag of log(y) and then include lylag in the regression.)
iii Add the real interest rate (r3) to the equation in part (i). Report the results in the usual form.
Does r3 affect consumption growth?
iv If we plot the time series of the real consumption, the trend went flat from year 1979 to 1982
before going up again. What is the estimated model if we also include a dummy variable
equal to 1 for years after 1979? Report the results in the usual form and comment.
4
6. Forecasting Competition (55%)
This part of the assignment will require substantial studying on your own as we have not covered much
of forecasting in lectures, however, this task will be highly relevant for real-world application of
econometrics. Each of you must provide your own write-up of your estimation practise and competition
report. Lab 8 and 10 provide the syntax and examples of the code that will be used in this project.
We will have a forecasting competition where each of you (or teams) will create forecasts of the
number of cyclists on the Galloping Goose Trail in Victoria (http://www.ecopublic.com/public2/?id=100117730).
The city makes daily cyclists counts publicly available and you
will build a forecasting model and subsequently predict the number of cyclists on the trail. There will
be a prize for the best (most accurate) forecasts.
The following tasks in part 1) will walk you through creating a simple forecasting model. You can then
build your own model and refine your predictions in part 2).
6.1) Estimation and Practise (20%)
i) Download the estimation data from CourseSpaces (“goose_a4.csv”) on the number of cyclists on
the Galloping Goose. Plot the variable ‘bikes_count’ as a line plot with time on the x-axis.
ii) Estimate a simple regression model, modelling the number of cyclists as a function of weekend and
month dummy variables, and report the results in a well-formatted table.
iii) What can you tell from the results in part (ii)?
iv) On May 28th, 2018 the new cycle lane across the bridge in Victoria was opened. Construct a dummy
variable that is equal to one following the opening of this cycle lane, and zero otherwise. Estimate and
interpret the effect of the opening of this cycle lane on the number of daily cyclists.
v) Create so-called `hind-casts’ – by estimating your model up until the end of the estimation sample
(Dec. 16th , 2018), and then predict the number of cyclists for the next h=15 periods. Discuss and
illustrate how your forecasts compare to the observed numbers of cyclists which are shown in column
`bikes_pred’ in the dataset?
vi) Compute the root-mean-squared forecast error of your forecasts:、
Do this by:
a) Computing the square of the difference between observed, bikes_pred) and your
predicted number of cyclists,
b) Computing the mean of the sum of the squares from part (a), and then taking the square
root.
vii) How does the root-mean-squared forecast error of this model compare to one that omits the
weekend dummy variables?
5
6.2) Forecasting Competition (35%)
i) Download the forecasting data: “goose_competition.csv” from CourseSpaces. It includes daily
observations of the number of cyclists up until July 11
th, 2019.
ii) Think of a general model of the number of cyclists on the Galloping Goose (variable `bikes’ in the
dataset). What regressors you would include (these would be observable and perhaps unobservable
factors that affect the number of cyclists each day, such as days of the week, month of the year, etc.)
Discuss how you could estimate your model from part, which variables are available, what are the
limitations of data availability?
ii) Estimate and describe your best prediction model for the number of cyclists on the Galloping
Goose, and predict the number of cyclists 20 days into the future (up until and including July 31st ) –
the most accurate forecasts will win.
This model could include trends, dummies for weekdays, interaction terms, autoregressive lags, etc.,
perhaps you only want to estimate the model on a shorter sample, or use the full sample. It’s up to
you! There are quite a few variables already in the dataset, but you can also build your own. The latest
date for the actual time-series data used in your forecast model is July 11th, 2019. If you (and your
team) used any actual time-series data dated after July 11th, 2019 (estimated data and the trend and
dummy variables generated based on date are allowed) in your forecast, your forecast would be
disqualified from the competition.
Plot your forecasts and describe your forecasting model carefully.
iii) Upload three files to CourseSpaces (under `Entry for Forecasting Competition’):
(1) Your data file as a “.csv” file. If you worked in a team, save the csv file as “team_name_data.csv”
replacing “team_name” with the name you have come up with (keep it simple please). Otherwise save
the file as “firstname_lastname_data.csv”, replacing “firstname” with your first name and “lastname”
with your last name.
(2) Your forecast results as a “.csv” file. The forecasts must be in a csv file and must take the form
shown below – the first column has to be the date (labelled as date), the second column the number of
predicted cyclists (labelled cyclists) from 2019-07-12 to 2019-07-31, and the third column must contain
all V-numbers of you and your team members. Similarly, if you worked in a team, save the csv file as
“team_name.csv” replacing “team_name” with the name you have come up with (keep it simple please).
Otherwise save the file as “firstname_lastname.csv”, replacing “firstname” with your first name and
“lastname” with your last name.
(3) Your R Markdown file. The R Markdown file should be up and running without error message with
your uploaded csv data file. Again, if you worked in a team, save the Rmd file as “team_name.Rmd”
replacing “team_name” with the name you have come up with (keep it simple please). Otherwise save
the file as “firstname_lastname.Rmd”, replacing “firstname” with your first name and “lastname” with
your last name.
If you worked in a team, please upload one Rmd file, one csv data file and one csv result file for each
team. Again, each of you must submit your own write-up of your report.
The most accurate forecast will be awarded a prize, but forecast accuracy will not affect your assignment
grade. Forecast accuracy will be judged by the lowest RMSE over July 12th
-July 31st
. Good luck!
Format of csv file:
date cyclists v_numbers
2019-07-12 254 (your prediction here) “V...”

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

微信:codehelp

转载于:https://www.cnblogs.com/ddaaff/p/11265770.html

Economics 345 “Applied Econometrics”相关推荐

  1. 大学加权平均分计算器_墨尔本大学商学院(MBS)2021研究生、博士、本科、预科录取要求更新...

    原创文章 | 澳洲政策解读 | 有趣活动 | 吃喝玩乐 | 关注我们没错哟 今年墨大录取的改动比较大,UNILINK会做一些各学院的录取要求和申请攻略,还没发布的专业和学院可以直接点下面卡片查询: 墨 ...

  2. Stata: 面板 Granger 因果检验

      作者:李珍 (厦门大学) Stata 连享会: 知乎 | 简书 | 码云 | CSDN Source: Luciano Lopez, Sylvain Weber, 2017, Testing fo ...

  3. wald检验_Stata: 面板 Granger 因果检验

    连享会-内生性专题-现场班 随着面板数据库规模的扩大,围绕面板数据因果关系的理论也迅速发展.面板数据正从具有大样本量( N )和较短时间维度( T )的微观面板数据转变为到具有大样本量( N )和长的 ...

  4. 经济类英文期刊排行榜

    转自https://zhuanlan.zhihu.com/p/145403268?ivk_sa=1024320u 顶尖期刊(5)A+ American Economic Review Economet ...

  5. 动态Probit模型及Stata实现

    原文链接:https://www.lianxh.cn/news/9b7224e2808ff.html 目录 1. 背景简介 2. 动态 Probit 模型简介 2.1 模型设定 2.2 模型估计 3. ...

  6. 大工18秋《计算机原理》,大工管经发【2015】6号大连理工大学管理与经济学部博士、硕士研究生学术论文标准...

    A*类50种 Academy of Management Journal Academy of Management Perspectives Academy of Management Review ...

  7. 倍分法DID:一组参考文献

    全文阅读:https://www.lianxh.cn/news/969f03ecfd5b2.html Source: Callaway, B., P. H. Sant'Anna, 2020, Diff ...

  8. matlab 高频数据,高频股价数据 算 波动率 的matlab code (Yacine Ait-Sahalia)

    用 R 算高频数据的日波动率 可以用 package " highfrequency ",这里给出的是matlab code. 说明:高频数据的波动率code 这个文件夹对应的是A ...

  9. 向量积判断优劣弧_判断经验论文优劣的10条诫命

    向量积判断优劣弧 There are a host of pathologies associated with the current peer review system that has bee ...

最新文章

  1. iOS 改变字符串中数字的颜色
  2. Nhibernate使用动态Expression的问题解决
  3. cpp cu入门教程
  4. 【正一专栏】《神秘巨星》总有一种真诚让你泪流满面
  5. c#精彩编程200例百度云_邂逅百度云智学院:福州理工学院AIOT实训营火热开营!...
  6. DEKR 解构式人体关键点回归(二):标签分配(Label Assignment)
  7. weblogic linux sun/awt/X11GraphicsEnvironment
  8. MIT大牛Gilbert Strang新书:《线性代数与从数据中学习》抢先看
  9. Activity——思维导图
  10. 中国移动:2016年全力推NFC,以公共交通为突破口
  11. 1250. Sea Burial
  12. QueryPerformanceFrequency
  13. RXJAVA之Subject
  14. dev万能头文件_Dev c++ 支持bits/stdc++.h万能头文件吗
  15. h5浏览器——扫码功能
  16. 如何查看、检测Windows XP-Windows10系统是否为正版
  17. 【蓝桥杯试题】盾神与困难数独
  18. linux上删除rime方案_超强的输入法:rime的配置(linux)
  19. Ansible 自动化运维工具之inventory和常用模块介绍
  20. [css] 【转载】 精简高效的CSS命名准则/方法

热门文章

  1. Hadoop集群中HDFS的API测试案例以及MapReduce的多种提交Job方式案例
  2. SNARK超详细解释,从GGPR13到Groth16
  3. Android 12 预览版发布,64g 手机用户哭了
  4. 哪款蓝牙耳机适合吃鸡?盘点2022适合苹果吃鸡的蓝牙耳机
  5. 内核线程ksoftirqd
  6. 使用ffmpeg调整图像大小
  7. python数据分析项目之超市零售分析
  8. 【076】朴素贝叶斯介绍
  9. LeetCode 881.救生艇
  10. Linux系统如何下载CityScape/KITTI-STEP数据集