
Contents |
Simple Linear Regression for LabTalk usage
1. fitLR (1,2);
2. fitLR i:=(1,2) N:=5;
3. fitLR (1,2) N:=-10;
4. fitLR iy:=(1,2) N:=-5 oy:=<new>;
| Display Name | Variable Name | I/O and Type | Default Value | Description |
|---|---|---|---|---|
| Input | iy |
Input XYRange | |
This variable specifies the input data range. |
| Fit Begin/End Points | N |
Input int | |
This variable specifies the number of points (from the beginning of the input data range) to use in the linear regression. |
| Intercept | a |
Output double | |
This variable specifies the Intercept |
| Slope | b |
Output double | |
This variable specifies the Slope |
| Intercept Error | aerr |
Output double | |
This variable specifies the Intercept Error |
| Slope Error | berr |
Output double | |
This variable specifies the Slope Error |
| Pearson r (correlation coefficient) | r |
Output double | |
Adjusted residuel sum of squares |
| Number of Actual Points Used | pts |
Output int | | |
| Output | oy |
Output XYRange | |
This variable specifies the Output range |
This X-Function calculates the slope and intercept of the linear regression line.
For more examples, please refer to XF Script Dialog (press F11).
The slope of the linear regression is given by the:
where And the intercept: