How to do a chi squared test on a linear fit

  • Context: Undergrad 
  • Thread starter Thread starter Stickybees
  • Start date Start date
  • Tags Tags
    Chi Fit Linear Test
Click For Summary
SUMMARY

The discussion focuses on performing a chi-squared test on a linear fit using Excel. The user seeks to understand the appropriateness of the chi-squared test in the context of fitting a linear equation to (x,y) data points, particularly when errors are known but not utilized by Excel. Key insights include the necessity of defining the test statistic and hypothesis clearly, as well as the importance of understanding the assumptions behind the Pearson's chi-squared statistic, which relies on the normal distribution of residuals.

PREREQUISITES
  • Understanding of chi-squared tests and their applications
  • Familiarity with linear regression and fitting equations
  • Basic knowledge of Excel functions and data analysis tools
  • Concept of residuals and their distribution in statistical analysis
NEXT STEPS
  • Research how to implement chi-squared tests in Python using libraries like SciPy
  • Learn about the assumptions of linear regression and how to validate them
  • Explore statistical software options for chi-squared tests, such as R or MATLAB
  • Investigate methods for incorporating error terms into regression analysis
USEFUL FOR

Statisticians, data analysts, researchers in physics and engineering, and anyone interested in applying chi-squared tests to linear regression analysis.

Stickybees
Messages
36
Reaction score
0
I'm getting a bit confused with the stats of a chi squared test, everyone in physics labs seems to use this as a test but I don't know why it's appropriate?

My main question is how would I take a linear equation in say excel which has been fitted to a series of (x,y) data points (I do have the errors for each point but excel doesn't use this) and fit use a chi squared test on this? (excel gives me an R2 value)

I have tried to find programs to do this automatically but none seem to be free.

Thanks for any help!
 
Physics news on Phys.org
Hey Stickybees.

You need to tell us the test statistic you are using (in terms or your data) as well as the hypothesis you are testing. Without these things there is bound to be some ambiguity in what you are talking about.
 
As chiro suggests, you have to say exactly what you are trying to accomplish. The phrase "Chi square test" by itself doesn't describe a goal. If you want to do what other people are doing, ask some of them about it. Find out the name of the software they are using - the documentation of the software might be available online, even if you can't get the software.

A "Pearsons" Chi square statistic is used to quantify the probability of some observed data under the assumption that it comes from some given distribution. If you want to use that test, you must specify what the data is and what the distribution is. A common assumption in fitting a straight line to data is that the "errors" or "residuals" in the y-values of the data are distributed as independent samples from a normal distribution distribution. Is that the assumption you wish to test?
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
9K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 26 ·
Replies
26
Views
3K