Compare two linear regressions.

조회 수: 9 (최근 30일)
Jorge Bonet Jara
Jorge Bonet Jara 2020년 10월 15일
답변: Chrystalleni 2023년 11월 2일
I am trying to obtain voltage-magnetizing inductance curve for an induction motor. The curve is expected to be linear between 386 volts an 400 volts. I want to obtain this curve for two relative positions between stator and rotor, normal assembly (Curve A) and displaced assembly (Curve B). If the displacement is of 90%, it is expected that CurvB = CurvA*0.9. Voltage is measure directly using an oscilloscope and inductance is estimated through a optimization process using a mathematical model of the motor. This process is affected by the noise in voltage and current measurements.
Once I get the data from the two conditions, I remove outliers and then apply fitlm() for both of them. Now, I want to know if the linear regressions are significantly different. They are meant to be two parallel lines.
How can I do this in Matlab? Is there any function I can use ?
Thank you very much.
Jorge
  댓글 수: 2
Jorge Bonet Jara
Jorge Bonet Jara 2020년 10월 15일
I'll explain myself better, just in case. Basically what I'm doing is comparing two sets of data. Data A: x1, y1 Data B: x2 , y2
These sets should fit theoretically:
yA=m+n*x1 for the first data set
yB=factor*(m+n*x2) for the second.
In this case factor=0.992 (in theory)
What I want to test/know is: if the two linear regressions I get using fitlm (one for each set) are statistically significantly different or in other words, if I could say that the change I made in the motor affected the original curve (data set A). To sum up:
what I want is to compare two linear regressions obtained using two sets of data (vectors x1, y1 and vectors X2 U2) (one for each regression) in order to know if the difference between regressions is statistically significant.
Jorge Bonet Jara
Jorge Bonet Jara 2020년 10월 15일
편집: Jorge Bonet Jara 2020년 10월 15일
Here is the results of the fitlm function

댓글을 달려면 로그인하십시오.

답변 (1개)

Chrystalleni
Chrystalleni 2023년 11월 2일
I know it's been long since this question was posted, but I came accross the same question, so I thought to write my solution here in case other people ask. Graphpad is using ANCOVA to compare the slopes and intercepts of two regression lines, so I believe you could use the [h,atab,ctab,stats] = aoctool(...) MATLAB function.

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by