Linear Least Squares Excel Template

Click For Summary

Homework Help Overview

The original poster is working on a Linear Least Squares Excel template for a Physics lab, specifically focusing on analyzing linear data. They report that while most values are calculated correctly, the standard deviation values are problematic and seek assistance in identifying the issue.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Participants discuss the order of calculations in Excel, particularly the placement of formulas for slope (m) and intercept (b) in relation to the calculation of a value (D). There is also a suggestion to create a new cell to reference D, and questions about the implications of using values before they are computed.

Discussion Status

Some participants have provided guidance on the order of calculations in Excel and the potential for errors when using uncomputed values in formulas. There is an exploration of alternative methods to handle division by zero errors, but no consensus has been reached on the best approach.

Contextual Notes

Participants note the presence of #DIV/0! errors in the original poster's calculations, indicating issues with the formulas used in the template. There is an emphasis on the importance of calculation order in Excel.

danielu13
Messages
67
Reaction score
0

Homework Statement


I had to make a Linear Least Squares Excel template for my first week's Physics lab to analyze linear data for the rest of the semester. All of my values come out correctly, except the standard deviation values. I was wondering if someone could take a look at my template and see what the problem is.


Homework Equations





The Attempt at a Solution


See attached file.
 

Attachments

Physics news on Phys.org
danielu13 said:

Homework Statement


I had to make a Linear Least Squares Excel template for my first week's Physics lab to analyze linear data for the rest of the semester. All of my values come out correctly, except the standard deviation values. I was wondering if someone could take a look at my template and see what the problem is.


Homework Equations





The Attempt at a Solution


See attached file.

You are using D (E26) in formulas before you calculate it. Your formulas for m and b need to come after (i.e., below or to the right of) values that are used to compute them.
 
Okay, I didn't realize that Excel worked in order like that. So it would work correctly if I put m and b below the D calculation, or could I put a new cell above these that is =E26, and change E26 for the new cell in the calculation formulas for m and b?
 
danielu13 said:
Okay, I didn't realize that Excel worked in order like that. So it would work correctly if I put m and b below the D calculation,
Yes.
danielu13 said:
or could I put a new cell above these that is =E26, and change E26 for the new cell in the calculation formulas for m and b?
I don't know what you're saying here. At any rate, you don't want to use a value in a formula before you have computed it. That's why you had all those #DIV/0! errors.
 
Mark44 said:
Yes.
I don't know what you're saying here. At any rate, you don't want to use a value in a formula before you have computed it. That's why you had all those #DIV/0! errors.

Another way to prevent this is to add a small positive quantity to the denominator, so (for example) instead of dividing by some quantity D you divide by something like D + 0.000001. That will make no practical difference in almost every real case. Alternatively, you could divide by max(D, .000001); so as long as D >= 0.000001 the denominator is not changed: it is still D.

RGV
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 42 ·
2
Replies
42
Views
6K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
2
Views
2K
  • · Replies 25 ·
Replies
25
Views
9K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 30 ·
2
Replies
30
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K