OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

fitLR


Contents

Brief Information

Simple Linear Regression for LabTalk usage

Command Line 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>;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input iy

Input

XYRange

<active>

This variable specifies the input data range.

Fit Begin/End Points N

Input

int

0

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

<unassigned>

This variable specifies the Intercept

Slope b

Output

double

<unassigned>

This variable specifies the Slope

Intercept Error aerr

Output

double

<unassigned>

This variable specifies the Intercept Error

Slope Error berr

Output

double

<unassigned>

This variable specifies the Slope Error

Pearson r (correlation coefficient) r

Output

double

<unassigned>

Adjusted residuel sum of squares

Number of Actual Points Used pts

Output

int

<unassigned>
Output oy

Output

XYRange

<optional>

This variable specifies the Output range

Description

This X-Function calculates the slope and intercept of the linear regression line.

Examples

For more examples, please refer to XF Script Dialog (press F11).

Algorithm

The slope of the linear regression is given by the:

Image:fitLR_help_English_files_image004.gif where Image:fitLR_help_English_files_image006.gif and Image:fitLR_help_English_files_image008.gif

And the intercept:

Image:fitLR_help_English_files_image010.gif

Related X-Functions