BioloMICS logo
×
BioloMICS menu

LINEST

 
Category: Statistical Function.
 
Description: The LINEST function calculates the statistics for a line by using the 'least squares' method to calculate a straight line that best fits your data, and then returns an array that describes the line.
 
You can also combine LINEST with other functions to calculate the statistics for other types of models that are linear in the unknown parameters, including polynomial, logarithmic, exponential, and power series.
 
Because this function returns an array of values, it must be entered as an array formula.
 
Instructions follow the examples in this article.
 
The equation for the line is:
y = mx + b
-or–
y = m1x1 + m2x2 + ... + b
 
If there are multiple ranges of x-values, where the dependent y-values are a function of the independent x-values.
 
The m-values are coefficients corresponding to each x-value, and b is a constant value.
 
Note that y, x, and m can be vectors.
 
The array that the LINEST function returns is {mn,mn-1,...,m1,b}.
 
LINEST can also return additional regression statistics.
 
 
Syntax: LINEST(known_y's, [known_x's], [const], [stats])
 
The LINEST function syntax has the following arguments:
 
Known_y's: Required. The set of y-values that you already know in the relationship y = mx + b.
  • If the range of known_y's is in a single column, each column of known_x's is interpreted as a separate variable.
  • If the range of known_y's is contained in a single row, each row of known_x's is interpreted as a separate variable.
 
Known_x's: Optional. A set of x-values that you may already know in the relationship y = mx + b.
The range of known_x's can include one or more sets of variables.
  • If only one variable is used, known_y's and known_x's can be ranges of any shape, as long as they have equal dimensions.
  • If more than one variable is used, known_y's must be a vector (that is, a range with a height of one row or a width of one column).
  • If known_x's is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known_y's.
 
Const: Optional. A logical value specifying whether to force the constant b to equal 0.
  • If const is TRUE or omitted, b is calculated normally.
  • If const is FALSE, b is set equal to 0 and the m-values are adjusted to fit y = mx.
 
Stats: Optional. A logical value specifying whether to return additional regression statistics.
  • If stats is TRUE, LINEST returns the additional regression statistics; as a result, the returned array is {mn,mn-1,...,m1,b;sen,sen-1,...,se1,seb;r2,sey;F,df;ssreg,ssresid}.
  • If stats is FALSE or omitted, LINEST returns only the m-coefficients and the constant b.