| 1|Space |Offices |Entrances |Age |Value | | 2| 2310| 2| 2| 20| $142000| | 3| 2333| 2| 2| 12| $144000| | 4| 2356| 3| 1.5| 33| $151000| | 5| 2379| 3| 2| 43| $150000| | 6| 2402| 2| 3| 53| $139000| | 7| 2425| 4| 2| 23| $169000| | 8| 2448| 2| 1.5| 99| $126000| | 9| 2471| 2| 2| 34| $142900| | 10| 2494| 3| 3| 23| $163000| | 11| 2517| 4| 4| 55| $169000| | 12| 2540| 2| 3| 22| $149000| Coeff: {=LinEst(Value,Space:Age,TRUE,TRUE) Value_Coeffs cf_Space cf_Offices cf_Entrances cf_Age Value_Coeff | 50.7119375064033| 12540.2618601525| 1248.79522496478| -250.135032384181| Value_CoeffStDev | 1.1143773497653| 745.040710790493| 808.598302879006| 23.7190624693514| Value_R2_StDevY | 0.987551875727871| 1807.14402004565| Value_F_DoF | 185.111239224289| 7| Value_SumSqrReg_SumSqrResid | 1813591922.59937| 22860386.5643072| } Estimated Values: {=MMult(Space:Age,Value_Coeff) )} LINEST function Description: The {b 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 {b 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 {b LINEST} function returns is ´{mn,mn-1,...,m1,b´}. {b LINEST} can also return additional regression statistics. Syntax: LINEST(knownYs, [knownXs], [const], [stats]) KnownYs: Required. The set of y-values that you already know in the relationship y = mx + b. KnownXs: Optional. The set of x-values; if KnownXs is omitted, it is assumed to be the array ´{1,2,3,...´} that is the same size as KnownYs. IsAffine: Optional = TRUE. Flag whether to force the constant b to equal 0 resp. the Function to be linear instead of affine. GetStats: Optional =FALSE. Flag whether to return additional regression statistics. {b ´{mn,mn-1,...,m1,b;sen,sen-1,...,se1,seb;r2,sey;F,df;ssreg,ssresid´}}. If GetStats is FALSE or omitted, {b LINEST} returns only the m-coefficients and the constant b. The additional regression statistics are as follows. |{b Statistic} |{b 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 {b {i 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 {b LINEST} to determine a confidence level for the model. For information about how df is calculated, see "Remarks," later in this topic. {h{https://support.office.com/en-us/article/LINEST-function-84d7d0d9-6e50-4101-977a-fa7abf772b6d#bmexample4} Example 4} 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. | Remarks: When you have only one independent x-variable, you can obtain the slope and y-intercept values directly by using the following formulas: Slope: INDEX(LINEST(knownYs,knownXs),1) Intercept: INDEX(LINEST(knownYs,knownXs),2) The accuracy of the line calculated by the {b LINEST} function depends on the degree of scatter in your data. The more linear the data, the more accurate the {b LINEST} model. {b LINEST} uses the method of least squares for determining the best fit for the data. When you have only one independent x-variable, the calculations for m and b are based on the following formulas: The line- and curve-fitting functions {b LINEST} and {b LOGEST} can calculate the best straight line or exponential curve that fits your data. However, you have to decide which of the two results best fits your data. You can calculate {b TREND(knownYs,knownXs)} for a straight line, or {b GROWTH(knownYs, knownXs)} for an exponential curve. These functions, without the {b newXs} argument, return an array of y-values predicted along that line or curve at your actual data points. You can then compare the predicted values with the actual values. You may want to chart them both for a visual comparison. In regression analysis, Spoc-Text calculates for each point the squared difference between the y-value estimated for that point and its actual y-value. The sum of these squared differences is called the residual sum of squares, ssresid. It then calculates the total sum of squares, sstotal. When the {b const} argument = TRUE or is omitted, the total sum of squares is the sum of the squared differences between the actual y-values and the average of the y-values. When the {b const} argument = FALSE, the total sum of squares is the sum of the squares of the actual y-values (without subtracting the average y-value from each individual y-value). Then regression sum of squares, ssreg, can be found from: ssreg = sstotal - ssresid. The smaller the residual sum of squares is, compared with the total sum of squares, the larger the value of the coefficient of determination, r2, which is an indicator of how well the equation resulting from the regression analysis explains the relationship among the variables. The value of r2 equals ssreg/sstotal. In some cases, one or more of the X columns (assume that Y’s and X’s are in columns) may have no additional predictive value in the presence of the other X columns. In other words, eliminating one or more X columns might lead to predicted Y values that are equally accurate. In that case these redundant X columns should be omitted from the regression model. This phenomenon is called “collinearity” because any redundant X column can be expressed as a sum of multiples of the non-redundant X columns. The {b LINEST} function checks for collinearity and removes any redundant X columns from the regression model when it identifies them. Removed X columns can be recognized in {b LINEST} output as having 0 coefficients in addition to 0 se values. If one or more columns are removed as redundant, df is affected because df depends on the number of X columns actually used for predictive purposes. If df is changed because redundant X columns are removed, values of sey and F are also affected. Collinearity should be relatively rare in practice. However, one case where it is more likely to arise is when some X columns contain only 0 and 1 values as indicators of whether a subject in an experiment is or is not a member of a particular group. If {b {i const}} = TRUE or is omitted, the {b LINEST} function effectively inserts an additional X column of all 1 values to model the intercept. If you have a column with a 1 for each subject if male, or 0 if not, and you also have a column with a 1 for each subject if female, or 0 if not, this latter column is redundant because entries in it can be obtained from subtracting the entry in the “male indicator” column from the entry in the additional column of all 1 values added by the {b LINEST} function. The value of df is calculated as follows, when no X columns are removed from the model due to collinearity: if there are k columns of {b {i known_x’s}} and {b {i const}} = TRUE or is omitted, df = n – k – 1. If {b {i const}} = FALSE, df = n - k. In both cases, each X column that was removed due to collinearity increases the value of df by 1. When entering an array constant (such as KnownXs) as an argument, use commas to separate values that are contained in the same row and semicolons to separate rows. Separator characters may be different depending on your regional settings. Note that the y-values predicted by the regression equation may not be valid if they are outside the range of the y-values you used to determine the equation. The underlying algorithm used in the {b LINEST} function is different than the underlying algorithm used in the {b SLOPE} and {b INTERCEPT} functions. The difference between these algorithms can lead to different results when data is undetermined and collinear. For example, if the data points of the KnownYs argument are 0 and the data points of the KnownXs argument are 1: {b LINEST} returns a value of 0. The algorithm of the {b LINEST} function is designed to return reasonable results for collinear data and, in this case, at least one answer can be found. {b SLOPE} and {b INTERCEPT} return a #DIV/0! error. The algorithm of the {b SLOPE} and {b INTERCEPT} functions is designed to look for only one answer, and in this case there can be more than one answer. In addition to using {b LOGEST} to calculate statistics for other regression types, you can use {b LINEST} to calculate a range of other regression types by entering functions of the x and y variables as the x and y series for {b LINEST}. For example, the following formula: =LINEST(yvalues, xvalues^COLUMN($A:$C)) works when you have a single column of y-values and a single column of x-values to calculate the cubic (polynomial of order 3) approximation of the form: y = m1*x + m2*x^2 + m3*x^3 + b You can adjust this formula to calculate other types of regression, but in some cases it requires the adjustment of the output values and other statistics. LINEST returns the F statistic, whereas FTEST returns the probability of this Statistic! This is a Sample *.STX File. (C) http://Spoc-Web.com