0

As the title states, that's what I am trying to do. I originally was following the solution to another post that was asking about the same question and this worked, until I started having data that had repeating x-values (But still different y-values). See below:

Graph

The red line is the correct fit applied by Excel, while the green, dotted line is the custom fit I apply. I am using the Excel fit to check against my own. So as can be seen, my fit is wildly off. The only thing I can see why this is happening is because of the repeating x-values. If this is the case, why does this matter mathematically? Because, from what I see from the formulas from the other post I was following, it shouldn't matter. The site is not allowing me to attach the Excel file, so here is the data and functions:

Data

b == (SUM(H7:H12)-(1/3)*SUM(D7:D12)*SUM(G7:G12))/(SUM(I7:I12)-(1/3)*SUM(D7:D12)^2)

a == (1/3)*SUM(G7:G12)-(1/3)K6SUM(D7:D12)

Sophia
  • 11

1 Answers1

1

Check your formula in Excel. They are mistakes. Note that the number of points is not 3 but 6. The original formula (from the link) is correct. This is the classical formula for linear regression.

enter image description here

JJacquelin
  • 66,221
  • 3
  • 37
  • 87