How Can I Determine the Linearity of Experimental Curves in Statistics?

Click For Summary
To determine the linearity of experimental curves, calculating the R² value is essential as it measures how well a linear regression fits the data. A high R² indicates good linearity, but it’s important to consider that lower R² values can still arise from linear data affected by noise. Fitting a line and analyzing the residuals can provide further insights; if the residuals show no pattern or follow a normal distribution, this supports the linearity of the data. The choice of regression type (linear, quadratic, etc.) depends on the specific characteristics of the data being analyzed. Ultimately, visualizing the data alongside the fitted line can also effectively demonstrate linearity.
roam
Messages
1,265
Reaction score
12

Homework Statement



I have two different experimental curves, and I would like to measure how closely a straight line fits each data, and which curve is more crooked. In statistics how can I measure this "linearity"?

By the way this is about stepper motor step linearity (ideally it has to be a straight line i.e. homogeneous step sizes). I am comparing the two plots made for two different speeds:

1582o3.jpg

Homework Equations

The Attempt at a Solution



I'm new to stats and I'm not sure what method to use. I'm very confused because some websites say I have to calculate the ##R^2## value, while others say I need a some kind of regression line. :confused:

So, if the linearity could somehow be determined from the equation of regression line, what kind of regression do I need to use (linear or quadratic, cubic, etc)? And how exactly do I determine linearity from that equation?

Any explanation is greatly appreciated.

P.S. I am using Matlab.
 
Physics news on Phys.org
roam said:
I'm very confused because some websites say I have to calculate the R2R^2 value, while others say I need a some kind of regression line.

I am not sure of the nomenclature, but I assume R2 is just a correlation coefficient, which in this case is a measure of how good the linear regression is. Two sides of the same coin.
 
  • Like
Likes roam
Borek said:
I am not sure of the nomenclature, but I assume R2 is just a correlation coefficient, which in this case is a measure of how good the linear regression is. Two sides of the same coin.

Thank you for the clarification. A high ##R^2## is what I think I will need to show good linearity.
 
R2 may be one way to do it but remember that is just a measure of how "far" away your linear fit is from the data (in the R2 it is squared to get rid of negative numbers and somehow normalized such that a perfect fit gets you a value of 1). You can have a lower R2 from noisy data which are still linear or from data which are not described well by a linear equation. What I would do is to fit a line, calculate the residuals, then either show the residuals are just noise with respect to the independent variable (this would just be a plot showing that there is no pattern to the residuals) or you can make a histogram/frequency plot of the residuals and show that they follow a gaussian/normal type of distribution.

It all depends on how far you want to go to show the linearity of your data (sometimes just plotting your line and data on the same graph is enough).
 
  • Like
Likes roam

Similar threads

Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 30 ·
2
Replies
30
Views
4K
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 64 ·
3
Replies
64
Views
5K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 19 ·
Replies
19
Views
4K