Data Handling & Analysis ZO4030 Linear Regression Andrew Jackson
Linear type data How are two measures related?
Testing this relationship How confident are we in this relationship? – Simple correlation test cor.test() Parametric Non-parametric What is the mathematical form of this relationship? – Linear regression Allows us to test different mathematical equations Allows us to predict values we have not observed
The equation of a line Mathematicians use – Y = mX + c Statisticians use – y = b 1 x + b 0 To calculate the coefficients use – b 1 = (y 2 -y 1 )/(x 2 -x 1 ) – b 0 = y-b 1 x
Different slopes Y = b 1 X + b 0 b 1 > 0 b 1 = 0 b 1 < 0
Different intercepts Y = b 1 X + b 0 Parallel lines
Sample data
Regression model assumptions Inherently assume a straight line relationship The residuals, or errors are assumed to be normally distributed – Need to test this – And make sure they are evenly spread above and below the line along its length
Computer Session One room for 16 from 2pm-4pm (EE PC 2) One room for 16 from 2pm-2.50pm (EE PC 1) Add body mass data to the brain size dataset – Link sent via We are going to investigate how brain size is related to body mass.