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 6

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 next 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. (60 marks)

This question uses a dataset on QMPlus.   For each student, there should be a file called “exercise6 XYZ.txt”, where XYZ is your ID number (you need to be logged in to QMPlus). If you cannot see a file, please send me an email.

For each part that asks for a bootstrap sample, use at least N  = 10, 000 bootstrap replications.

(a) Calculate a BCa 95% confidence interval for the mean of the variable x1.

For the remaining parts, use the variables x1 and x2, and assume for this question that they are two independent samples.

(b) Calculate the bootstrap standard error and a 95% confidence interval (using a

percentile method) for the difference between the means of the measurements for the two groups.

(c) Suppose that we are interested in how the variability of the two groups compares,

as measured by

1

where σ 1 and σ2 are the standard deviations of the measurements in the two groups, respectively. Calculate a 95% bootstrap percentile confidence interval for r .         What does this interval tell us about the variability in the two groups?

Hint:  think  about for which  values  of r  a group  is  more  variable  than  the  other. Then,  consider the definition of confidence interval (for r) .

Additional problems

2) If the random samples x and y are independent of each other, then

VaT( y¯) = VaT() + VaT(y¯).

Suppose that we only had code to estimate the bootstrap standard error for the mean in a one-sample problem. If we are interested in the difference in means between two in- dependent samples x and y, explain how we could use the code to estimate the standard error of the difference in means.

3) Show that the sampling scheme described in practical 7 to generate x and y as bivariate normal random variables with correlation ρ does in fact do this.