Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MTH6991/MTH791U/MTH791P

Computational Statistics with R

Exercise Sheet 7

Spring 2023

The questions in the first section are due to be handed in for assessment along with those in the first section from the previous  exercise sheet.  The link for submission will be in the week 8 section on QMPlus.  The deadline is 13:00 on Thursday the 30th March, late submissions will receive zero marks.

Problems for handing in

1. (40 marks)

This question uses the same dataset as exercise sheet 6.  For each part that asks for a bootstrap sample, use at least N = 10, 000 bootstrap replications.

We want to fit a simple linear model of the form

E(Y) = β0 + β1x

For the response Y , use the variable y. As the covariate x, use whichever of x1, x2, x3 or x4 has the largest mean.

(a) Fit the linear model referred to above to the original dataset. Report the coefficient

for the slope (i.e. β 1 ) and its standard error as calculated using normal least-squares theory (by reporting the R output from lm, not by any hand calculation).

(b)  By bootstrapping cases,  calculate the standard error of the slope in the linear

model (i.e.  the coefficient of the covariate), and also a 95% percentile confidence interval for this coefficient.

(c)  Still bootstrapping cases, calculate a 95% BCa confidence interval for the coefficient for the covariate. What does this confidence interval tell us about the relationship between the response and the covariate?

(d)  Repeat part 1.b but this time bootstrap residuals instead of cases.

Additional problems

2)  Repeat part 1.b but this time using a parametric bootstrap.

3) Use the bootstrap and bcanon functions to calculate BCa and percentile confidence intervals for the correlation coefficient between the scores in the law dataset.