After the Dimitri's comment I deeply reviewed this file. Now this file use the Regress function (but the results with Polyfit were the same). Anyway I wrote this function exclusively for the common use of a one estimator linear regression; a common laboratory use where a simple regression is required.
Now this function checks the presence of outliers (as the Robustfit).
This function computes a least-squares linear regression suppling several output informations:
- Presence of outliers
- Slope with standard error an 95% C.I.
- Intercept with standard error an 95% C.I.
- Pearson's Correlation coefficient with 95% C.I. and its adjusted form (depending on the elements of X and Y arrays)
- Spearman's Correlation coefficient
- Regression Standard Error
- Total Variability
- Variability due to regression
- Residual Variability
- Student's t-Test on Slope (to check if slope=0), with power
- Student's t-Test on Intercept (to check if intercept=0) with power
- Power of the regression
- Modified Levene's test for homoschedasticity of residuals
- Deming regression parameters
- a plot with:
o Data points
o Least square line
o Red dotted lines: 95% Confidence interval of regression
o Green dotted lines: 95% Confidence interval of new y evaluation using this regression.
- the residuals plot
The function requires the Statistics Toolbox because calls TINV and TCDF to perform the Student's t-test.
To compute power, Myregr requires powerStudent by Trujillo-Ortiz, A. and R. Hernandez-Walls. If this function is not present on the computer, it will try to download it from FEX
My profile on LinkedIN http://it.linkedin.com/in/giuseppecardillo |