CS计算机代考程序代写 matlab ECON61001 (Semester1): Computer assignment 1 Due Monday, 15 November, 2021

ECON61001 (Semester1): Computer assignment 1 Due Monday, 15 November, 2021

THE TASK

You are assigned a dataset from theWooldridge package based on the last digit of your student ID number.
Submitting a report for a wrong dataset results in the mark of zero for this assignment. This computer
assignment corresponds to 10% of your final grade. The details about individual dataset and models are
provided on the pages below.

Your answers have to be reported in the following table.

STUDENT ID NUMBER: (insert here)

Question 1
TSS ESS RSS R̄2adj

Question 2
β̂ Test statistic p-value Test decision

Question 3
Size α = 5% Power D1 Power D2 Size α = 1%

You have to submit a single pdf file which starts with the above table. Fill in your answers in the table.
For all the numbers report the first 3 digits after the decimal point: 3.567 instead of 3.6. You then have to
include your R or MATLAB code. Hint: in RStudio go to File – Knit Document and include the generated
report. The code will compile if and only if it is written without mistakes. If your code does not compile you
still have to include it (just copy and paste as a text after the table).

The submission deadline for this assignment is noon UK time on November 15, 2021. The report has to
be submitted in the pdf format via Turnitin on Blackboard. Please use your student ID as the file name,
e.g. 12345.pdf. The assignment will be marked in accordance with the general SoSS PG Marking Criteria
(available on Blackboard). Please make sure you are familiar with the University’s rules and regulations
regarding plagiarism.

In general your task is to produce an analysis of commonly used tests for statistical significance.

STUDENT ID NUMBERS ENDING WITH 0 OR 1

• ID Example: 123450 or 123451.

• Use the Wooldridge dataset econmath to analyse the effect of taking a calculus course on the score
in econometrics class.

• Use help(econmath) to get the variable description.

• For the regression analysis use y = score, x1 = colgpa, x2 = study, x3 = calculus.

1. Estimate a linear model of the form

yi = β0 + β1xi1 + β2xi2 + β3xi3 + ui (1)

Report the TSS, ESS, RSS and adjusted coefficient of determination R̄2adj . Insert your answers in the
table.

Page 1 of 5

ECON61001 (Semester1): Computer assignment 1 Due Monday, 15 November, 2021

2. Conduct a test ofH0 : β3 ≤ 5 at 5% significance level. Report the estimated coefficient, an appropri-
ate test statistic with a corresponding p-value. What is the test decision? Insert your answers in the
table.

3. Examine the power and size properties of the given test of H0 : δ3 ≤ 5 in a simulation study with
the fixed regressors design overMC = 1000 simulation draws. For every simulation iteration keep
explanatory variables x1, x2, x3 fixed. Do not forget to fix the random seed to the simulation iteration
i as set.seed(i). Use the sample size n from the assigned dataset. Set the coefficients for the
data generating process to: δ = (δ0, δ1, δ2, δ3) = (31, 14, 0, 5).

• In order to investigate the size of the test generate u ∼ N (0, 1) and yi = δ0 + δ1xi1 + δ2xi2 +
δ3xi3 +ui for every simulation iteration. Regressors xij remain fixed. Report the size of the test
for the 5% significance level.

• Power Design 1 (D1 in the table). Generate u ∼ N (0, 1) and yi = δ̃0 + δ̃1xi1 + δ̃2xi2 + δ̃3xi3 + ui
with δ̃ = (31, 14, 0, 5.1). Report the power of the test for the 5% significance level.

• Power Design 2 (D2 in the table). Generate u ∼ N (0, 1) and yi = δ̃0 + δ̃1xi1 + δ̃2xi2 + δ̃3xi3 + ui
with δ̃ = (31, 14, 0, 4.9). Report the empirical null rejection probability for the 5% significance
level.

• In order to investigate the size of the test generate u ∼ N (0, 1) and yi = δ0 + δ1xi1 + δ2xi2 +
δ3xi3 +ui for every simulation iteration. Regressors xij remain fixed. Report the size of the test
for the 1% significance level.

• Insert your answers in the table.

STUDENT ID NUMBERS ENDING WITH 2 OR 3

• ID Example: 123452 or 123453.

• Use the Wooldridge dataset affairs to analyse the effect of happiness in marriage on the number
of affairs.

• Use help(affairs) to get the variable description.

• For the regression analysis use y = naffairs, x1 = age, x2 = yrsmarr, x3 = ratemarr.

1. Estimate a linear model of the form

yi = β0 + β1xi1 + β2xi2 + β3xi3 + ui (2)

Report the TSS, ESS, RSS and adjusted coefficient of determination R̄2adj . Insert your answers in the
table.

2. Conduct a test ofH0 : β3 ≥ −1 at 5% significance level. Report the estimated coefficient, an appro-
priate test statistic with a corresponding p-value. What is the test decision? Insert your answers in
the table.

3. Examine the power and size properties of the given test of H0 : δ3 ≥ −1 in a simulation study with
the fixed regressors design overMC = 1000 simulation draws. For every simulation iteration keep
explanatory variables x1, x2, x3 fixed. Do not forget to fix the random seed to the simulation iteration
i as set.seed(i). Use the sample size n from the assigned dataset. Set the coefficients for the
data generating process to: δ = (δ0, δ1, δ2, δ3) = (5, 0, 0,−1).

• In order to investigate the size of the test generate u ∼ N (0, 1) and yi = δ0 + δ1xi1 + δ2xi2 +
δ3xi3 +ui for every simulation iteration. Regressors xij remain fixed. Report the size of the test
for the 5% significance level.

Page 2 of 5

ECON61001 (Semester1): Computer assignment 1 Due Monday, 15 November, 2021

• Power Design 1 (D1 in the table). Generate u ∼ N (0, 1) and yi = δ̃0 + δ̃1xi1 + δ̃2xi2 + δ̃3xi3 + ui
with δ̃ = (5, 0, 0,−0.9). Report the empirical null rejection probability for the 5% significance
level.

• Power Design 2 (D2 in the table). Generate u ∼ N (0, 1) and yi = δ̃0 + δ̃1xi1 + δ̃2xi2 + δ̃3xi3 + ui
with δ̃ = (5, 0, 0,−1.1). Report the power of the test for the 5% significance level.

• In order to investigate the size of the test generate u ∼ N (0, 1) and yi = δ0 + δ1xi1 + δ2xi2 +
δ3xi3 +ui for every simulation iteration. Regressors xij remain fixed. Report the size of the test
for the 1% significance level.

• Insert your answers in the table.

STUDENT ID NUMBERS ENDING WITH 4 OR 5

• ID Example: 123454 or 123455.

• Use theWooldridge dataset catholic to analyse effect of gender on the score inmathematics exam.

• Use help(catholic) to get the variable description.

• For the regression analysis use y = math12, x1 = lfaminc, x2 = female, x3 = fatheduc.

1. Estimate a linear model of the form

yi = β0 + β1xi1 + β2xi2 + β3xi3 + ui (3)

Report the TSS, ESS, RSS and adjusted coefficient of determination R̄2adj . Insert your answers in the
table.

2. Conduct a test ofH0 : β2 ≥ −1 at 5% significance level. Report the estimated coefficient, an appro-
priate test statistic with a corresponding p-value. What is the test decision? Insert your answers in
the table.

3. Examine the power and size properties of the given test of H0 : δ2 ≥ −1 in a simulation study with
the fixed regressors design overMC = 1000 simulation draws. For every simulation iteration keep
explanatory variables x1, x2, x3 fixed. Do not forget to fix the random seed to the simulation iteration
i as set.seed(i). Use the sample size n from the assigned dataset. Set the coefficients for the
data generating process to: δ = (δ0, δ1, δ2, δ3) = (14, 2,−1, 1).

• In order to investigate the size of the test generate u ∼ N (0, 1) and yi = δ0 + δ1xi1 + δ2xi2 +
δ3xi3 +ui for every simulation iteration. Regressors xij remain fixed. Report the size of the test
for the 5% significance level.

• Power Design 1 (D1 in the table). Generate u ∼ N (0, 1) and yi = δ̃0 + δ̃1xi1 + δ̃2xi2 + δ̃3xi3 + ui
with δ̃ = (14, 2, 0, 1). Report the empirical null rejection probability for the 5% significance level.

• Power Design 2 (D2 in the table). Generate u ∼ N (0, 1) and yi = δ̃0 + δ̃1xi1 + δ̃2xi2 + δ̃3xi3 + ui
with δ̃ = (14, 2,−1.01, 1). Report the power of the test for the 5% significance level.

• In order to investigate the size of the test generate u ∼ N (0, 1) and yi = δ0 + δ1xi1 + δ2xi2 +
δ3xi3 +ui for every simulation iteration. Regressors xij remain fixed. Report the size of the test
for the 1% significance level.

• Insert your answers in the table.

Page 3 of 5

ECON61001 (Semester1): Computer assignment 1 Due Monday, 15 November, 2021

STUDENT ID NUMBERS ENDING WITH 6 OR 7

• ID Example: 123456 or 123457.

• Use the Wooldridge dataset econmath to analyse the effect of time spent studying on the score in
econometrics class.

• Use help(econmath) to get the variable description.

• For the regression analysis use y = score, x1 = colgpa, x2 = study, x3 = calculus.

1. Estimate a linear model of the form

yi = β0 + β1xi1 + β2xi2 + β3xi3 + ui (4)

Report the TSS, ESS, RSS and adjusted coefficient of determination R̄2adj . Insert your answers in the
table.

2. Conduct a test ofH0 : β2 = 0 at 5% significance level. Report the estimated coefficient, an appropri-
ate test statistic with a corresponding p-value. What is the test decision? Insert your answers in the
table.

3. Examine the power and size properties of the given test of H0 : δ2 = 0 in a simulation study with
the fixed regressors design overMC = 1000 simulation draws. For every simulation iteration keep
explanatory variables x1, x2, x3 fixed. Do not forget to fix the random seed to the simulation iteration
i as set.seed(i). Use the sample size n from the assigned dataset. Set the coefficients for the
data generating process to: δ = (δ0, δ1, δ2, δ3) = (31, 14, 0, 5).

• In order to investigate the size of the test generate u ∼ N (0, 1) and yi = δ0 + δ1xi1 + δ2xi2 +
δ3xi3 +ui for every simulation iteration. Regressors xij remain fixed. Report the size of the test
for the 5% significance level.

• Power Design 1 (D1 in the table). Generate u ∼ N (0, 1) and yi = δ̃0 + δ̃1xi1 + δ̃2xi2 + δ̃3xi3 + ui
with δ̃ = (31, 14, 0.01, 5). Report the power of the test for the 5% significance level.

• Power Design 2 (D2 in the table). Generate u ∼ N (0, 1) and yi = δ̃0 + δ̃1xi1 + δ̃2xi2 + δ̃3xi3 + ui
with δ̃ = (31, 14,−0.01, 5). Report the power of the test for the 5% significance level.

• In order to investigate the size of the test generate u ∼ N (0, 1) and yi = δ0 + δ1xi1 + δ2xi2 +
δ3xi3 +ui for every simulation iteration. Regressors xij remain fixed. Report the size of the test
for the 1% significance level.

• Insert your answers in the table.

STUDENT ID NUMBERS ENDING WITH 8 OR 9

• ID Example: 123458 or 123459.

• Use the Wooldridge dataset affairs to analyse the effect of age on the number of affairs.

• Use help(affairs) to get the variable description.

• For the regression analysis use y = naffairs, x1 = age, x2 = yrsmarr, x3 = ratemarr.

Page 4 of 5

ECON61001 (Semester1): Computer assignment 1 Due Monday, 15 November, 2021

1. Estimate a linear model of the form

yi = β0 + β1xi1 + β2xi2 + β3xi3 + ui (5)

Report the TSS, ESS, RSS and adjusted coefficient of determination R̄2adj . Insert your answers in the
table.

2. Conduct a test ofH0 : β1 ≤ 0 at 5% significance level. Report the estimated coefficient, an appropri-
ate test statistic with a corresponding p-value. What is the test decision? Insert your answers in the
table.

3. Examine the power and size properties of the given test of H0 : δ1 ≤ 0 in a simulation study with
the fixed regressors design overMC = 1000 simulation draws. For every simulation iteration keep
explanatory variables x1, x2, x3 fixed. Do not forget to fix the random seed to the simulation iteration
i as set.seed(i). Use the sample size n from the assigned dataset. Set the coefficients for the
data generating process to: δ = (δ0, δ1, δ2, δ3) = (5, 0, 0,−1).

• In order to investigate the size of the test generate u ∼ N (0, 1) and yi = δ0 + δ1xi1 + δ2xi2 +
δ3xi3 +ui for every simulation iteration. Regressors xij remain fixed. Report the size of the test
for the 5% significance level.

• Power Design 1 (D1 in the table). Generate u ∼ N (0, 1) and yi = δ̃0 + δ̃1xi1 + δ̃2xi2 + δ̃3xi3 + ui
with δ̃ = (5, 0.01, 0,−1). Report the power of the test for the 5% significance level.

• Power Design 2 (D2 in the table). Generate u ∼ N (0, 1) and yi = δ̃0 + δ̃1xi1 + δ̃2xi2 + δ̃3xi3 + ui
with δ̃ = (5,−1, 0,−1). Report the empirical null rejection probability for the 5% significance
level.

• In order to investigate the size of the test generate u ∼ N (0, 1) and yi = δ0 + δ1xi1 + δ2xi2 +
δ3xi3 +ui for every simulation iteration. Regressors xij remain fixed. Report the size of the test
for the 1% significance level.

• Insert your answers in the table.

Page 5 of 5