ECON61001 (Semester1): Computer assignment 1 Due Monday, 4 January, 2021
THE TASK
You are assigned a dataset from the Wooldridge 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)
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 12.00hrs Greenwich Mean Time January 4, 2021. The report has to be submitted via Turnitin on Blackboard. 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 heteroscedasticity.
1. Estimate a linear model of the form (individual for every dataset, details below)
yi =β0 +β1xi1 +β2xi2 +β3xi3 +ui (1) Report the sample mean and sample standard deviation of each explanatory variable. Insert your
answers in the table.
2. Conduct a test for heteroscedasticity (individual for every dataset, details below)
• Compute the F-test version of the test together with the corresponding p-value. Do you reject the null hypothesis at the 5% level?
• ComputetheLM-testversionofthetesttogetherwiththecorrespondingp-value.Doyoureject the null hypothesis at the 5% level?
• Insert your answers in the table.
3. Examine the power and size properties of the given heteroscedasticity test in a simulation study with the fixed regressors design over MC = 1000 simulation draws. For every simulation iteration keep explanatory variables x1, x2, x3 fixed. Use the sample size n from the assigned dataset. Set the coefficients for the data generating process to the OLS estimates from (1): δ = βˆOLS .
• 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 F-version of the test and LM-version of the test separately.
Question 1
x ̄1
x ̄2
x ̄3
σˆ [ x 1 ]
σˆ [ x 2 ]
σˆ [ x 3 ]
Question 2
F
p-value
Test decision
LM
p-value
Test decision
Question 3
Size F
Size LM
Power F D1
Power LM D1
Power F D2
Power LM D2
Page 1 of 3
jj
ECON61001 (Semester1): Computer assignment 1 Due Monday, 4 January, 2021
• InordertoinvestigatethepowerpropertiesofthetestinstalltheMASSpackage.Usethefunction mvrnorm to simulate the heteroscedastic error term: mvrnorm(mc, rep(0,n),Sigma).
• Power Design 1 (D1 in the table). Generate u ∼ N(0,Σ), with Σii = xi1 and Σij = 0 ∀i ̸= j and yi = δ0 + δ1xi1 + δ2xi2 + δ3xi3 + ui for every simulation iteration. Report the power of the F-version of the test and LM-version of the test separately.
• PowerDesign2(D2inthetable).Generateu∼N(0,Σ),withΣii =xi1+xi2 andΣij =0∀i̸=j and yi = δ0 + δ1xi1 + δ2xi2 + δ3xi3 + ui for every simulation iteration. Report the power of the F-version of the test and LM-version of the test separately.
• Insert your answers in the table.
STUDENT ID NUMBERS ENDING WITH 0 OR 1
• ID Example: 123450 or 123451.
• UsetheWooldridgedatasetwage2toanalysetheBreusch-Pagantestforheteroscedasticity,i.e.use the misspecified auxiliary regression of the form
u2 =α0 +α1×1 +α2×2 +α3×3 +ξ.
• Use help(wage2) to get the variable description.
• Follow the task step details from page 1.
• For the regression analysis use y = wage, x1 = educ, x2 = exper, x3 = IQ
STUDENT ID NUMBERS ENDING WITH 2 OR 3
• ID Example: 123452 or 123453.
• UsetheWooldridgedatasetwage2toanalysetheWhitetestforheteroscedasticityinitsgeneralform (not in terms of yˆ), i.e. use the misspecified auxiliary regression of the form
u2 =α0 +α1×1 +α2×2 +α3×3 +α4×1 ·x2 +α5×1 ·x3 +α6×2 ·x3 +α7×21 +α8×2 +α9×23 +ξ.
• Use help(wage2) to get the variable description.
• Follow the task step details from page 1.
• For the regression analysis use y = wage, x1 = educ, x2 = exper, x3 = IQ
Page 2 of 3
ECON61001 (Semester1): Computer assignment 1 Due Monday, 4 January, 2021
STUDENT ID NUMBERS ENDING WITH 4 OR 5
• ID Example: 123454 or 123455.
• UsetheWooldridgedatasetbeautytoanalysetheBreusch-Pagantestforheteroscedasticity,i.e.use the misspecified auxiliary regression of the form
u2 =α0 +α1×1 +α2×2 +α3×3 +ξ.
• Use help(beauty) to get the variable description.
• Follow the task step details from page 1.
• For the regression analysis use y = lwage, x1 = looks, x2 = exper, x3 = educ
STUDENT ID NUMBERS ENDING WITH 6 OR 7
• ID Example: 123456 or 123457.
• Use the Wooldridge dataset beauty to analyse the White test for heteroscedasticity in its general form (not in terms of yˆ), i.e. use the misspecified auxiliary regression of the form
u2 =α0 +α1×1 +α2×2 +α3×3 +α4×1 ·x2 +α5×1 ·x3 +α6×2 ·x3 +α7×21 +α8×2 +α9×23 +ξ.
• Use help(beauty) to get the variable description.
• Follow the task step details from page 1.
• For the regression analysis use y = lwage, x1 = looks, x2 = exper, x3 = educ
STUDENT ID NUMBERS ENDING WITH 8 OR 9
• ID Example: 123458 or 123459.
• Use the Wooldridge dataset campus to analyse the White test for heteroscedasticity in its general form (not in terms of yˆ), i.e. use the misspecified auxiliary regression of the form
u2 =α0 +α1×1 +α2×2 +α3×3 +α4×1 ·x2 +α5×1 ·x3 +α6×2 ·x3 +α7×21 +α8×2 +α9×23 +ξ.
• Use help(campus) to get the variable description.
• Follow the task step details from page 1.
• For the regression analysis use y = crime, x1 = enroll, x2 = police, x3 = priv
Page 3 of 3