Skip to content
Rodrigo Celso de Lima Porto edited this page Jan 13, 2026 · 1 revision

Calculates the intercept $B$ of the linear regression line $Y = AX + B$ between two numerical lists X and Y.

Syntax

List.Intercept(
    X as list,
    Y as list
) as number

Parameters

  • X: A list of numerical values representing the independent variable.
  • Y: A list of numerical values representing the dependent variable.

Return Value

Returns a number representing the intercept of the linear regression line calculated using the least squares method. If the lists have different lengths, the function returns null.

Remarks

  • Both input lists must have the same length; otherwise, the function returns null.
  • The function uses the least squares method to calculate the intercept.
  • Non-numeric values in the lists will cause an error during calculation.

Example

Example 1: Calculating the intercept value of linear regression.

List.Intercept({1, 2, 3}, {4, 5, 6})

Result

-1

Example 2: Returns null if the input lists have different lengths.

List.Intercept({1, 2}, {3})

Result

null

Clone this wiki locally