dna model -> Statistics m34 galaxy -> Research 2xfj protein -> Links protein gel -> Personal Bristol Balloon Fiesta SuSTaIn UoB
Mathematics home Statistics home Research People Seminars Postgrad opportunities SuSTaIn Peter Green Research > Teaching Statistics 1 home .. downloads .. end of course summary (pdf) .. sections .. using R .. R demos .. extra books Links Personal APTS Complexity science Royal Statistical Society International Society for Bayesian Analysis Royal Society

4. Linear regression & Least squares estimation

Aims | Objectives | Reading | Handouts & Problem Sheets | Questions | Links

Return to the Statistics 1 home page

Aims

In this section we provide a brief introduction to the ideas and methods of simple linear regression.

Objectives

The following objectives will help you to assess how well you have mastered the relevant material. By the end of this section you should be able to:

  • State the model assumptions under which a simple linear regression model is appropriate for describing and analysing a set of data consisting of predictor values and corresponding response values.
  • Produce a scatter plot of response values against predictor values, both by hand and in R.
  • Compute least squares estimates of the slope and intercept of the fitted regression line, by hand and in R, and add the line to a scatter plot of the data.
  • Comment critically on any deviations from the assumptions of the model that are apparent from the plot of the data values together with the fitted regression line.
  • Compute the fitted values and the residual values, plot the residual values against either the predictor values or the fitted values, and comment critically on any deviations from the assumptions of the model that are apparent from the plot.

Suggested Reading

RiceChapter 14 Section 14.1 Linear Least Squares - Introduction
Section 14.2 Simple Linear Regression


Handouts and Problem Sheets

Copies of Handouts, Problem Sheets and Solution Sheets for the unit will be made available each week here.

Handout for Section 4 | Problem sheet 5 | Solution sheet 5
Some people have said they have difficulty accessing the crabs
data for the homework. I think all the information you need is
on either the handout or the problems sheet, but for emphasis:

1. Download crabs.R to your computer

2. Use the File > Source R Code menu item or the 
source('crabs.R') command to read it in to R.

[Steps 1 and 2 can be combined if you are using R while 
online, as on the problem sheet]

3. attach(crabs)

The variables premoult and postmoult will then be 
available to you in the normal way.

Copyright notice

© University of Bristol 2011

All material in these pages is copyright of the University unless explicitly stated otherwise. It is provided exclusively for educational purposes at the University and is to be downloaded or copied for your private study only, and not for distribution to anyone else.

Please also note that material from previous years' delivery of this unit is not necessarily a reliable indicator of what will be covered or examined this year.


Questions - set this week

PROBLEM SHEET 5 -- Questions 1, 4, 5

Interesting links

R demos - the function I used in lectures 8 and 9 to visualise some aspects of linear regression and least squares.

There are a number of nice linear regression applets that will help develop your understanding of various aspects of the subject.

For example:
(i) the Rice University site has an applet which lets you draw on estimated regression lines and see the corresponding value of the residual sum of squares, so you can try and guess where the best fitting line goes.
(ii) the California State University site has applets which let you mark the location of ordered pairs (X,Y), and then determines the equation of the regression line and graphs it.

Note that I have no control over the content or availability of these external web pages. The links may be slow to load, or may sometimes fail altogether - please email me to report if a link goes down. Similarly applets may be slow to load or run, but beware that you may experience problems if you try to exit them before they have finished loading.

Professor Peter Green, School of Mathematics, University of Bristol, Bristol, BS8 1TW, UK.
Email link Telephone: +44 (0)117 928 7967; Fax: +44 (0)117 928 7999
Peter in Chinese characters email as QR barcode