# I Working out the equation for coordinates on a graph

Tags:
1. Mar 6, 2017

### Saints-94

I have a series of data points for X and Y points on a graph. The data is quite random and I am trying to work out a trend line so I can then form an equation for the line. How would I go about working out the equation for the data below.
(0, 580)
(6.7, 495)
(13.4, 445)
(18.7, 365)
(22.8, 350)
(27, 340)

2. Mar 6, 2017

### Staff: Mentor

Unless there is an underlying model that would suggest otherwise, I would consider that to be a straight line and do a linear least-square fit.

3. Mar 6, 2017

### Saints-94

I'm not sure how I can apply that to the data that I have. Where would I start with working out an equation?

4. Mar 6, 2017

### Staff: Mentor

You need to first calculate the averages, $\bar{x}$ and $\bar{y}$. Then use eqs. (16) and (20) in the link I gave you to get $\mathrm{ss}_{xx}$ and $\mathrm{ss}_{xy}$. You then get the slope from eq. (27) and the intercept from eq. (28).

5. Mar 7, 2017

### Saints-94

I was expecting to get a trend line that looked like an exponential curve. Is it possible to work out an equation that would give me an exponential curve?

6. Mar 7, 2017

### Staff: Mentor

The problem with the non-linear case is that you can't get a direct answer. It becomes a multidimensional minimization problem.

The best is to use existing software to do this. Most graphing programs can do this, as well as other software such as Matlab.

7. Mar 7, 2017

### Saints-94

Ok, thanks. I have the Matlab software, but am unsure how to programme my data.

8. Mar 7, 2017