Using Linear regression Watch

sonic23
Badges: 1
Rep:
?
#1
Report Thread starter 8 years ago
#1
when you have an equation of the form y= mx + c, and you plot a graph of y against x, how can you use linear regression to find the slope m and the intercept c.

Is this just drawing a line of best fit and then carrying on as you normally would? or does it involve a more accurate method?
0
reply
rnd
Badges: 6
Rep:
?
#2
Report 8 years ago
#2
(Original post by sonic23)
when you have an equation of the form y= mx + c, and you plot a graph of y against x, how can you use linear regression to find the slope m and the intercept c.

Is this just drawing a line of best fit and then carrying on as you normally would? or does it involve a more accurate method?
When you have an equation of the form y=mx + c you already have the slope and intercept.

I don't think that's what you meant though.

If you have a load of (x,y) pairs you have to choose m and c so as to minimise

Sum of (mx+c-y)^2

If you haven't studied how to do this then you should probably just look up linear regression formulae. They're given for example in A level formula books.
0
reply
sonic23
Badges: 1
Rep:
?
#3
Report Thread starter 8 years ago
#3
(Original post by rnd)
When you have an equation of the form y=mx + c you already have the slope and intercept.

I don't think that's what you meant though.

If you have a load of (x,y) pairs you have to choose m and c so as to minimise

Sum of (mx+c-y)^2

If you haven't studied how to do this then you should probably just look up linear regression formulae. They're given for example in A level formula books.
There seems to be two methods i have come across.

One with the Sxy and Sxx calculations, and the other with two 'normal equations'.

Which one is more efficient?

Thanks
0
reply
rnd
Badges: 6
Rep:
?
#4
Report 8 years ago
#4
They're the same thing.

Solving the normal equations leads to the Sxy/Sxx formula.

So using Sxy/Sxx nearly all the work has already been done for you and that's probably the way you want to go.

Depends what you were set to do or what you set yourself to do.
0
reply
sonic23
Badges: 1
Rep:
?
#5
Report Thread starter 8 years ago
#5
(Original post by rnd)
They're the same thing.

Solving the normal equations leads to the Sxy/Sxx formula.

So using Sxy/Sxx nearly all the work has already been done for you and that's probably the way you want to go.

Depends what you were set to do or what you set yourself to do.
Ok thank you very much.
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • University of the West of England, Bristol
    Undergraduate Open Afternoon - Frenchay Campus Undergraduate
    Wed, 23 Jan '19
  • University of East London
    Postgraduate Open Evening Postgraduate
    Wed, 23 Jan '19
  • University of Gloucestershire
    School of Education Open Day Postgraduate
    Wed, 23 Jan '19

Brexit: Given the chance now, would you vote leave or remain?

Remain (1621)
79.15%
Leave (427)
20.85%

Watched Threads

View All
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise