Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

add a trend line to a scatter graph

for my physics work i had to plot a graph and i need to add a trendline to the graph. I have plotted the graph as a scatter chart but dont know how to add a line of best fit, please help

Apple, Mac OS X (10.5.5)

Posted on Jan 1, 2009 11:27 AM

Reply
4 replies

Jan 1, 2009 1:41 PM in response to JohSmith_123

Search "linear regression' in Numbers Help.

The FORECAST() function can be used to calculate the end points for the trend line using the minimum and maximum X values in your data set for the x value argument.

For example, with your data pairs listed in B3:B12 (x values) and C3:C12 (y values), add these values and formulas:
D3: 0
E3: =FORECAST(D3, C3:C$12, B3:B12)

D4: =MAX(B3:B12)
E4: =FORECAST(D4, C3:C$12, B3:B12)

The data pair on row 3 mark the y axis intercept of the trend line.
The pair on line 4 mark the position of the trend line where its x value is equal to the maximum x value of the data set. As plotting this pair may obscure the data point at this x value, you may want to move the trend line point to the right. To do this, add an arbitrary amount to the value in D4. The size of the added amount will depend on the scale of your graph.

eg. D4: =MAX(B3:B12)+2

If your data set includes negative x values, replace the formula in D3 with the mirror of the one in D4:

D3: =MIN(B3:B12)-2

Again, the "-2" is an arbitrary value used to extend the trend line beyond the collected x values.

This will allow you to plot these two points onto your scatter graph as a second data set. I don't see a means of making Numbers connect the points, so you will have to add the line manually.

Regards,
Barry

add a trend line to a scatter graph

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.