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

Discrete Data Analysis

MATH20811 Practical Statistics: Coursework 2

(November 2023)

Road casualties in Greater London during 2022

The marks awarded for this coursework constitute 30% of the total assessment for the module.

Your solution to the coursework should be reasonably concise - a maximum of about 10 pages with tables, plots, and code, but there is no penalty if you do exceed this.  It should take, on average, about 15 hours to complete all the work.

Please read all the instructions and advice given below carefully.

The submission deadline is 10:00 am on Wednesday 22 November 2023 .

Late Submission of Work: Any student’s work that is submitted after the given deadline will be classed as late, unless an extension has already been agreed via mitigating circumstances or a DASS extension.

The following rules for the application of penalties for late submission are quoted from the latest University guidance on late submission document, version 1.4 (dated November 2020):

”Any work submitted at any time within the irst 24 hours following the published submission deadline will receive a penalty of 10% of the maximum amount of marks available.  Any work submitted at any time between 24 hours and up to 48 hours late will receive a deduction of 20% of the marks available, and so on, at the rate of an additional 10% of available marks deducted per 24 hours, until the assignment is submitted or no marks remain.”

Your submitted solutions should all be in one pdf document which must be prepared using LaTeX. Failure to use LaTeX will result in a 5 mark penalty.

For each part of the project you should provide explanations as to how you completed what is required, show your workings and also comment on computational results, where applicable.

When you include a plot, be sure to give it a title and label the axes correctly.

When you have written or used R code to answer any of the parts, then you should list this R code after the particular written answer to which it applies. This may be the R code for a function you have written and/or code you have used to produce numerical results, plots and tables. R code should be clearly annotated. Use the verbatim environment in LaTeX.

Do not use screenshots of R plots, or output in your report. You have seen earlier in the course how to include graphics in LaTeX.

Your ile should be submitted through the Turnitin assessment called ”CW2 2023”in the folder ”MATH20811 CW2” under Assessment & Feedback on Blackboard and by the above time and date. Work will be marked anonymously on Blackboard so please ensure that your ilename is clear but that it does not contain your name and student id number. Similarly, do not include your name and id number in the document itself.

There is a basic LaTeX template ile on Blackboard which you may choose to use for typing-up your solutions. The ile is called CW2_submitted_work. tex.

Turnitin will generate a similarity report for your submitted document and indicate matches to other sources, including billions of internet documents (both live and archived), a subscription repository of periodicals, journals and publications, as well as submissions from other students. Please ensure that the document you upload represents your own work and is written in your own words. The Turnitin report will be available for you to see shortly after the due date.

Marking rubric: There are 6 questions to complete in the coursework, with a total of 25 marks to be obtained. An additional 5 marks are awarded for the presentation of the report, where we assess the clarity of writing, graphs, diagrams, tables and code, and the use of consistent notation. This coursework should hopefully help to reinforce some of the methodology you have been study- ing, as well as the skills in R you have been developing in the module. Correct interpretation and meaningful discussion of the results (i.e.  attempt to put the results into context) are important in order to achieve a high mark for the coursework.

The following table gives the numbers of road casualties in Greater London during 2022, cat- egorised as being either ”fatal”, ”serious” or ”slight” and grouped by ive modes of transport.

Casualty Severity

Fatal    Serious    Slight Sum

Mode of Transport    Pedestrian 41         1194      3320 4555

Pedal Cycle 7        1020      4064 5091

Motorcycle 21           873      5257 6151

Car 25         501     8476 9002

Other Vehicle Occupants 8          271      2129 2408

Sum 102 3859 23246 27207

The question of interest is whether for people sufering injuries, the ive modes of transport difer in their respective probabilities of the severity of those injuries.   You should regard the row sums as being fxed quantities here.

1.  Given the description of the data, write down a suitable probability model for this matrix of counts.

State the statistical hypotheses of interest here. [2 marks]

2.  Read the data into R and then convert the counts to appropriate proportions.  Present the proportions data graphically and comment on the resulting plot. [5 marks]

3.    (i)  Explain how the expected frequencies are calculated under the assumption that your H0 is true and obtain their values for these data.  (You do not need to use diy calculations here.); [2 marks]

(ii) Test H0 vs H1 using a signiicance level α = 0:05 and a critical value from the asymptotic null distribution of your test statistic.  (You should clearly state what this distribution is.) State your conclusions. [2 marks]

4.  Print out some appropriate sets of residuals and comment on their values in the light of the conclusions you made in question 3(ii). [3 marks]

5. Write a function in R to obtain B = 5000 values of the test statistic, each one calculated using a set of data simulated under the assumption that the null hypothesis is true.  You should aim to e伍ciently make use of for loops in doing this.

Produce a histogram of these simulated values, superimpose the plot of the asymptotic null distribution and comment informally on the goodness-of-it. [5 marks]

6.  Construct approximate 95% conidence intervals for:

(i) the diference between the probability that a cyclist sufering an injury is seriously injured and the probability that a car driver sufering an injury is seriously injured; [3 marks]

(b)  motorcyclists sufering injuries only, the diference between the probabilities of a serious injury and a slight injury. [3 marks]

[Total marks = 25]