PDA

View Full Version : Statistics, line diagram & linear regression


confusedkarl
Jun 18, 2008, 08:15 AM
3(a) Draw a line diagram of the data.

Data given:

Hour Measurement
1 3.005
2 3.020
3 2.980
4 3.015
5 2.995
6 3.010
7 3.000
8 2.985
9 3.025
10 3.005

I did a scatter plot (I assume this is correct as question 3b shows, I need to find the equation of the linear regression line that would best fit the given data and graphical estimation is not accepted)

The graph I did by hand: http://i250.photobucket.com/albums/gg277/captainkarl_2008/image_sb_1.jpg

The same graph in Excel with a line I believe to be best fit?!
http://i250.photobucket.com/albums/gg277/captainkarl_2008/excelgraph.jpg

I can do all the linear regression stuff but I am not sure

a) I have the right "line diagram"
b) That there's any relationship at all for a line of best fit, however there has to be as the next question (20 marks) says; find the equation of the linear regression line that would best fit the given data and graphical estimation is not accepted)


Please help :-(

galactus
Jun 18, 2008, 09:34 AM
I get y=.0001818x+3

This has an R^2 of .001443, which is very bad. The line is not going to fit good at all.

confusedkarl
Jun 18, 2008, 09:42 AM
Just as I feared... yet the next question states:

Find the equation of the linear regression line that would best fit the given data and graphical estimation is not accepted)

did you work out the linear equation line Galactus?

galactus
Jun 18, 2008, 09:53 AM
Yes, that is what I posted above.

confusedkarl
Jun 18, 2008, 10:09 AM
Thank you for all your help so far galactus. Do you think its worth proceeding to answer the final question, even though the graph created from data given on my question paper does look odd? I have to comment on the trend of the data after I work out the linear regression.

galactus
Jun 18, 2008, 10:16 AM
It would appear there is no significant positive corelation between the data.

confusedkarl
Jun 22, 2008, 05:59 AM
galactus, please can you help me with working out the linear equation line. I can't see how you got to your answer. :-( thanks

galactus
Jun 22, 2008, 06:35 AM
I ran it through my TI-92 calculator. Excel does a fine job of dong these. I have a very nice, written, Excel macro for statistics. It has me rather spoiled. I sure didn't do it by hand. The formula for an linear regression is cumbersome. That is why we use tech to do them.

confusedkarl
Jun 22, 2008, 12:17 PM
could you possibly help me work out the linear equation mathematically and not graphically? Or supply me with this amazing spreadsheet you speak of?

galactus
Jun 22, 2008, 12:24 PM
I can not give you my sheet, but I can guide you through how to do it with regular old Excel.

Enter your data in column A and column B.

In the toolbar, click on INSERT

CHART

XY SCATTER

NEXT

NEXT

NEXT

FINISH

In the toolbar go to CHART

ADD TRENDLINE

OPTIONS

Check the boxes that say, "display equation in chart" and "display R-squared"

OK

That should be it. You have your graph with the equation of the line in the upper right hand corner.

confusedkarl
Jun 22, 2008, 12:37 PM
Isn't that kind of cheating though? I don't think my teacher would be happy...

galactus
Jun 22, 2008, 12:45 PM
Cheating? I don't think so. That's how I do them.

galactus
Jun 22, 2008, 02:40 PM
Here is the formula for finding a regression line. This is why we use tech.

For y=mx+b, where x and y are your given points.

m=\frac{n\sum xy -(\sum x)(\sum y)}{n\sum x^{2} - (\sum x)^{2}}

b=\overline{y}-m\overline{x}

confusedkarl
Jun 23, 2008, 03:04 AM
What does r squared represent?

galactus
Jun 23, 2008, 05:21 AM
That is the coorelation coefficient. That is how accurate your line is. The closer to 1 or -1 the better.