R plays an important role in the course and being able to programme is definitely a plus on the job market. Have a look at this website if you are not convinced.

R support will be provided for the first 6 weeks by Skevi Michael, in room G9 (main Mathematics building) on Thursdays 11-12 and Fridays 9-10.

Weekly homework involves coding using the statistical software package R.

Formal details of this course are available on the unit description page.

Drop-in sessions: Mondays 10-11, right after the lecture. I will be in my office (Room 4.1) if you would like to ask about the course.

Problem sheet n, n=1,...,10, covers the material seen in Chapter/Week n and should normally be completed/handed in week n+1.

Solutions to the problems sheets will be made available two weeks after they have been set.

Lecture notes (with gaps filled in the lectures) will be made available at the end of each week.

This should not give you a false sense of security and encourage you to miss lectures. Experience shows that attending lectures is the best way to remain engaged with the material covered in this course.

There are 10 weeks of lectures, followed by revision sessions.

Week 1 [or 13] (starting 22/1)

- Lecture notes: chapter 1.
- Problems sheet 1
solutions, solutions to R questions

Week 2 [or 14] (starting 29/1)

- Lecture notes: chapter 2.
- Problems sheet 2
solutions, solutions to R questions

Week 3 [or 15] (starting 5/2)

- Lecture notes: chapter 3.
- Problems sheet 3
solutions, no R in week 3.

Week 4 [or 16] (starting 12/2)

- Lecture notes: chapter 4.
- Problems sheet 4
solutions, solutions to R questions.

Week 5 [or 17] (starting 19/2)--Skevi Michael gives the lecture on 21/2

- Lecture notes: chapter 5.

- Problems sheet 5
solutions, solutions to R questions.

Week 6 [or 18] (starting 26/2)

- Lecture notes: chapter 6.

- Problems sheet 6
solutions.

Week 7 [or 19] (starting 5/3)

- Lecture notes: chapter 7.

- Problems sheet 7 solutions

Week 8 [or 20] (starting 12/3)

- Lecture notes: chapter 8.

- Problems sheet 8 solutions

Week 9 [or 21] (starting 19/3)

- Lecture notes: chapter 9.

- Additional note on the
estimation of sigma^2. (not examinable).

- Problems sheet 9 solutions

Week 10 (starting 16/4)

- Lecture notes: chapter 10.
--
**contrary to what I said in the lecture**, the confidence interval in Example 10.2 is correct!

- Problems sheet 10
solutions

- Some notes
concerning examinability of taught material.

- Revision class
notes.

If you misplace your lecture notes here is a pdf file of the lecture notes, with gaps. I will not provide you with a second set of printed lecture notes.

R support will be provided for the first 6 weeks by Skevi Michael, in room G9 (main Mathematics building) on Thursdays 11-12 and Fridays 9-10. However the best way is to use free resources available from the internet.

You might be interested in the document An Introduction to R, despite its name, this is fairly comprehensive. For a more gentle introduction, try R: A self-learn tutorial written for undergraduates or Simon Wood's book. Another good document can be found here---but this is more advanced.

When you become
an R power-user, you will want to access the contributed
packages on CRAN, the Comprehensive R
Archive Network (see below how to install packages).

Note that this concerns your R code and associated comments only--for the rest of your homework you should use pen and paper, and hand this in to your tutor directly.

What makes R very useful to statisticians is that there are numerous packages developed by others in order to solve various statistical problems, and available to you. Not all packages are available by default, and must therefore be installed when needed. You can install a package by clicking on the "Tools" menu, and then click "Install Packages" (see the knitr example below).## Installing packages

In order to make this work, you should ensure that the knitr library is installed in R studio--this is simple and just requires a few clicks.## Installing knitr

To check whether knitr is already installed you can type help(knitr) in the console. If a help page for knitr appears in the Help tab then there is no need to install knitr, and you can start your homework. Otherwise,

Note again that on computers in the computer lab (G9) you may have to define the R_USER variable first. Follow this link for detailed instructions. You may have to restart R studio for this to take effect.

On macOS and Windows

- In the menu "Tools" click "Install Packages"
- A pop-up menu appears and you should type "knitr" in the "Packages" field.
- Click "Install" -- if a message appears saying that knitr is
already installed, then simply cancel.

You should first download and save the template in your favourite folder (right click on the link and choose the right option in the menu) change its name to yoursurname-yourfirstname-HW-XX.Rmd, where XX is the homework number, and open this file in R studio. Note that depending on how it is set up, your browser may save your file with a different extension (e.g. .txt), which you should change to .Rmd## Preparing your answers to the homework R questions

In R studio go into "File" and click "Open File" and look for the file you have just saved. If you just want to check whether knitr and R studio are properly set up you can go to "Exporting your work..." below directly. Otherwise...

You can type your code in the relevant places (see the examples in the template)

```{r}

# INSERT YOUR CODE HERE ...

```

and, where relevant, add your comments in the blanks indicated as

* WRITE DOWN YOUR COMMENTS HERE...

It is important that you insert your R code between ```{r} and ```

Note that you can test your code line by line in the console, check variable values etc., by simply cutting and pasting into the console, or more conveniently you can click the green triangle in the top right corner to execute the code. The latter will run your code in the corresponding "chunk" and insert the output right after.

The simplest methods consists of exporting as a pdf or Word (if installed on your computer-- it is installed on School of Mathematics computers) or an html document. You can get these options by clicking on the wool ball to get the drop down menu, and then select a method. You can then save this document and save a copy as a pdf file (option available in Word in "Save as", followed by changing the format to pdf). In some cases R may ask to install additional libraries, just say "yes".## Exporting your work in a document and handing it in

If you decide to export in a pdf file directly from R studio, you will have to make sure that Miktex (Windows) or Mactex (Apple) is installed (these are not R packages and you should just follow the links). Both are free, but this may add an extra layer of complication for you. This seems to be working on the computers in G9 in the School of Mathematics.

Note that on computers in G9 it may take a while for the document to appear on your screen the first time you run this.

In order to limit paper usage you can submit your R homework via Blackboard or via a shared folder set up by your tutor. Your tutor will let you know what their preferred method is.

Here is how to submit your homework via
Blackboard:

- Go to the Statistics 1 Blackboard course
page.
- Click on ‘Homework Submission’ on the
left-hand navigation pane.
- Upload your homework in the relevant week
i.e. Sheet n should be placed in Week n+12, for n=1,...,10.

- John A. Rice, 1995, Mathematical Statistics and Data Analysis, Duxbury Press, 2nd ed. This is the international student edition. There is also a 3rd edition, but this seems to be very expensive.
- A First Course in
Probability by S. Ross.

- Introductory Statistics with R by Peter Dalgaard.