File Exchange

image thumbnail


version (15.3 KB) by Giuseppe Cardillo
A simple routine to compare two LS regressions


Updated 05 Apr 2018

View Version History

GitHub view license on GitHub

Compare two linear regressions.
This function compares two least-square linear regression. Test are implemented as reported by Stanton A. Glantz book This routine uses MYREGR function. If it is not present on the computer, myregrcomp will try to download it from FEX. Syntax: x=myregrcomp(x1,y1,x2,y2)
x1,y1 - data of first regression
x2,y2 - data of second regression
- Summary of MYREGR function
- Global test
- Test on slopes (eventually)
- Test on intercepts (eventually)

Created by Giuseppe Cardillo

To cite this file, this would be an appropriate format: Cardillo G. (2007) MyRegressionCOMP: a simple routine to compare two LS regressions.

Cite As

Giuseppe Cardillo (2020). MyRegrComp (, GitHub. Retrieved .

Comments and Ratings (2)

Giuseppe Cardillo

To compare two regressions (as reported in Stanton A. Glantz book) firstly you must perform the regressions. This is the reasons of code repeating. But, if you look well the code calls three times the same function (MYREGR): once for the first regression, once for the second regression and once for the overall regression. So, the code is really repeated?
I think that FPRINTFs are necessary because I want to look the results in a clearly way. Antonio Trujillo Ortiz (I think he is one of the best of us) uses the same code but I don't see any comment about this.
Finally, I'm interested in collaboration. How do you change the code?

Dimitri Shvorob

'Fiducial level' is 'significance level'. The programming is bad: chunks of code are repeated, and FPRINTFs take up most of space anyway. Calculations are very simple - but can the author explain what test exactly he is implementing? (A reference perhaps?)

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!