Compare two linear regressions.
Show older comments
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 Comments
Jorge Bonet Jara
on 15 Oct 2020
Jorge Bonet Jara
on 15 Oct 2020
Edited: Jorge Bonet Jara
on 15 Oct 2020
Answers (1)
Chrystalleni
on 2 Nov 2023
1 vote
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.
Categories
Find more on Linear and Nonlinear Regression in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!