How do you create a line of best fit from data in excel?

A

Alex

Sara

The best way I am aware of is...

If your data is in chart from, then right click any data
point and select <Add Trendline...>

Then select type <Linear> and then click the <Options>
tab and checkmark <Disply Equation On Chart>. this will
give the formula for the line as best fit in the form of
the standardised y = bx + c.

In effect this is a linear regression and gives you the
line of best fit bith in visual form (i.e. the line it
puts on the chart) and algebraic form (i.e. the equation).

Does this help? I will check back if you need any further
assistance.

Regards


Alex
 
S

Sara Beaver

Thanks a lot. That did help. Now, I have a follow up question: (this one you
may not be able to do, but its worth a shot, right?) Can you also plot a
point on the line of best fit based on a y value and get an x value for it? I
dont know if that's clear or not, but I have a lab, and I have a set of data,
and I created the line of best fit. Now, I need to take an unknown substance
and find the concentration (the x value) based on the y value I found and
make it show up on the graph. Does that make any more sense? I mean, I could
do it by hand, but that would not look too good, and if I have the program, I
might as well use it, right? Thanks for the help so far-
~Sara
 
A

Alex

Sara

Glad to help.

So the way I see it is as follows. You have made
calculations to determine the concentration of a
substance (x value) based on a y value. You have plotted
these points on a graph (scatter graph most appropriate
here as you are dealing with bivariate data points of the
form [x,y]) and you have now obtained a line of best fit
for the data. This is the basis of regression analysis. I
am presuming that there is some kind of relationship
between x and y that is evident from the chart e.g. high
values of y associated with high concentrations of x.
Even if there is no discernible relationship it is of
little consequence.

The next step is to take a value of y and predict the x
value from the line of best fit? I think that is what you
mean. (I presume you are not going to experimentally
determine the x value from the y). So, given that value y
is known, you can read off the predicted x value from the
line of best fit. Best to just use the equation of the
line of best fit and do the simple algebra to obtain the
x value, given y. So if y = 2x + 10 and y is 30, then we
know x = 10.

Now to get your data point onto the line of best fit. In
Excel spreadsheet you should have placed your y value and
predicted x value into cells. e.g. cell A1 = y A2 =
predicted x.

Now in your chart, right click the mouse and select
<Source Data>. You will most likely just have
one 'Series' on the chart known as 'Series 1'. At any
rate you need to select <Add Series> and in the adjacent
boxes type in the cell references for your x and y values.
So y may be =sheet1!$A$1 (use name of sheet if you have
one instead of 'sheet1')
and x may be =sheet1!$A$2 (based on the example I gave
above)

This will add your new data point onto the chart as a
separate series. Now back on the chart you can double
click that data point and assign it a different colour
etc. so that it stands out from your original data.

I hope this helps and is what you were requesting. Again,
please reply if your are still struggling and I will
endeavour to assist.

Thanks

Alex
 
S

Sara Beaver

Thank you very much, this was a lot of help for me! Sorry it took so long to
get back to you, I've been out of town for a while. But thanks again!
~Sara

Alex said:
Sara

Glad to help.

So the way I see it is as follows. You have made
calculations to determine the concentration of a
substance (x value) based on a y value. You have plotted
these points on a graph (scatter graph most appropriate
here as you are dealing with bivariate data points of the
form [x,y]) and you have now obtained a line of best fit
for the data. This is the basis of regression analysis. I
am presuming that there is some kind of relationship
between x and y that is evident from the chart e.g. high
values of y associated with high concentrations of x.
Even if there is no discernible relationship it is of
little consequence.

The next step is to take a value of y and predict the x
value from the line of best fit? I think that is what you
mean. (I presume you are not going to experimentally
determine the x value from the y). So, given that value y
is known, you can read off the predicted x value from the
line of best fit. Best to just use the equation of the
line of best fit and do the simple algebra to obtain the
x value, given y. So if y = 2x + 10 and y is 30, then we
know x = 10.

Now to get your data point onto the line of best fit. In
Excel spreadsheet you should have placed your y value and
predicted x value into cells. e.g. cell A1 = y A2 =
predicted x.

Now in your chart, right click the mouse and select
<Source Data>. You will most likely just have
one 'Series' on the chart known as 'Series 1'. At any
rate you need to select <Add Series> and in the adjacent
boxes type in the cell references for your x and y values.
So y may be =sheet1!$A$1 (use name of sheet if you have
one instead of 'sheet1')
and x may be =sheet1!$A$2 (based on the example I gave
above)

This will add your new data point onto the chart as a
separate series. Now back on the chart you can double
click that data point and assign it a different colour
etc. so that it stands out from your original data.

I hope this helps and is what you were requesting. Again,
please reply if your are still struggling and I will
endeavour to assist.

Thanks

Alex
-----Original Message-----
Thanks a lot. That did help. Now, I have a follow up question: (this one you
may not be able to do, but its worth a shot, right?) Can you also plot a
point on the line of best fit based on a y value and get an x value for it? I
dont know if that's clear or not, but I have a lab, and I have a set of data,
and I created the line of best fit. Now, I need to take an unknown substance
and find the concentration (the x value) based on the y value I found and
make it show up on the graph. Does that make any more sense? I mean, I could
do it by hand, but that would not look too good, and if I have the program, I
might as well use it, right? Thanks for the help so far-
~Sara


.
 
Top