Syntax

expression.LinEst(Arg1, Arg2, Arg3, Arg4)

expression A variable that represents a WorksheetFunction object.

Parameters

Name Required/Optional Data Type Description
Arg1 Required Variant Known_y's - the set of y-values you already know in the relationship y = mx + b.
Arg2 Optional Variant Known_x's - an optional set of x-values that you may already know in the relationship y = mx + b.
Arg3 Optional Variant Const - a logical value specifying whether to force the constant b to equal 0.
Arg4 Optional Variant Stats - a logical value specifying whether to return additional regression statistics.

Return Value
Variant

Remarks

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-value is 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 LINEST returns is {mn,mn-1,...,m1,b}. LINEST can also return additional regression statistics.

The additional regression statistics are as follows.

Statistic Description
se1,se2,...,sen The standard error values for the coefficients m1,m2,...,mn.
seb The standard error value for the constant b (seb = #N/A when const is FALSE).
r2 The coefficient of determination. Compares estimated and actual y-values, and ranges in value from 0 to 1. If it is 1, there is a perfect correlation in the sample - there is no difference between the estimated y-value and the actual y-value. At the other extreme, if the coefficient of determination is 0, the regression equation is not helpful in predicting a y-value. For information about how r2 is calculated, see "Remarks" later in this topic.
sey The standard error for the y estimate.
F The F statistic, or the F-observed value. Use the F statistic to determine whether the observed relationship between the dependent and independent variables occurs by chance.
df The degrees of freedom. Use the degrees of freedom to help you find F-critical values in a statistical table. Compare the values you find in the table to the F statistic returned by LINEST to determine a confidence level for the model. For information about how df is calculated, see "Remarks" later in this topic. Example 4 below shows use of F and df.
ssreg The regression sum of squares.
ssresid The residual sum of squares. For information about how ssreg and ssresid are calculated, see "Remarks" later in this topic.

The following illustration shows the order in which the additional regression statistics are returned.

worksheet


See also: