# MA890: Coursework Assessment on R HANDING IN YOUR WORK A WHAT to hand in: a written report (pdf,…

MA890: Coursework Assessment on R HANDING IN YOUR WORK A WHAT to hand in: a written report (pdf, created using LT X) answering the E questions below. You should also EMAIL me a single .R le containing any R code that you generate, so that I can see if it runs correctly. Label di erent questions with comment lines and leave at least one blank line between each question. Send from your Kent account to ak96@kent.ac.uk in an email headed MA890 R code. WHEN to hand in: BEFORE NOON on Friday 26 January 2018 (Week 14), at the SMSAS General O ce. ASSESSMENT: Overall, this assessment will count for 30% of your nal mark for this module. PLAGIARISM: It is important to work on this assessment individually and not consult other students. The School's plagiarism policy is available at www.kent.ac.uk/smsas/currentstudents/policyprocedures/plagiarism.pdf 1. Give R code using the function rep() to create the following vectors? (i) 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 (ii) 1 2 2 2 2 2 3 3 4 4 5 [2 marks] 2. Give R code using the function seq() to produce a vector of twenty increasing equally spaced points between -2 and 3. [1 mark] 3. Give R code to evaluate the following, without using loops 25 10 i i X X 2 3 10 + i(i 1): 2 3 i i i i=1 i=1 [2 marks] 4. ProvideR code which uses a loop to generate samples of size 100 fromt-distributions with degrees of freedom equal to 1, 2, 4, 8, 16, 32 and stores them in the columns of a 100 6 matrix. Create a histogram of each sample, together with a normal probability plot complete with a line to assess how straight the Q-Q plot is. The plots should be arranged in a 2 6 array on a single graph sheet, with the his- tograms on the top row and the Q-Q plots in the bottom row. Each plot should have a title with an indication of the distribution (including degrees of freedom) used to generate the data. [5 marks]5. Carefully describe what is accomplished by the following piece of R code, com- menting on each line of the code: x