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

Click For Summary
SUMMARY

This discussion focuses on determining the linearity of experimental curves, specifically in the context of stepper motor step linearity using MATLAB. Key methods mentioned include calculating the R² value and fitting regression lines to the data. A high R² indicates a good linear fit, but it is essential to analyze residuals to confirm linearity. The conversation emphasizes that visualizing residuals can provide insights into the data's linearity beyond just the R² value.

PREREQUISITES
  • Understanding of R² value in regression analysis
  • Familiarity with linear regression techniques
  • Basic knowledge of residual analysis
  • Proficiency in MATLAB for data analysis and plotting
NEXT STEPS
  • Learn how to perform linear regression in MATLAB
  • Study the concept of residuals and their significance in regression analysis
  • Explore methods for visualizing residuals, such as histogram and frequency plots
  • Investigate the implications of R² values in different types of regression models
USEFUL FOR

Statisticians, engineers working with stepper motors, and anyone involved in data analysis who seeks to understand and measure the linearity of experimental curves.

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   Reactions: 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   Reactions: 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