趋势线

趋势线可以添加于除饼形图和股价图之外的所有类型的2D图表上。

要访问此命令...

Choose Insert - Trend Line (Charts)


批注图标

If you insert a trend line to a chart type that uses categories, like Line or Column, then the numbers 1, 2, 3, are used as x-values to calculate the trend line. For such charts the XY chart type might be more suitable.


批注图标

A trend line is shown in the legend automatically. Its name can be defined in options of the trend line.


趋势线与对应的数据序列具有相同的颜色。要更改线条属性,请选择趋势线并选择格式 - 格式选择 - 线条

Trend Line Equation and Coefficient of Determination

When the chart is in edit mode, LibreOffice gives you the equation of the trend line and the coefficient of determination R2, even if they are not shown: click on the trend line to see the information in the status bar.

To show the trend line equation, select the trend line in the chart, right-click to open the context menu, and choose Insert Trend Line Equation.

To change format of values (use less significant digits or scientific notation), select the equation in the chart, right-click to open the context menu, and choose Format Trend Line Equation - Numbers.

Default equation uses x for abscissa variable, and f(x) for ordinate variable. To change these names, select the trend line, choose Format - Format Selection – Type and enter names in X Variable Name and Y Variable Name edit boxes.

To show the coefficient of determination R2, select the equation in the chart, right-click to open the context menu, and choose Insert R2.

批注图标

If intercept is forced, coefficient of determination R2 is not calculated in the same way as with free intercept. R2 values can not be compared with forced or free intercept.


趋势线曲线类型

The following regression types are available:

约束

趋势线的计算只考虑带有下列值的数据对:

您应该相应地转换数据;最好在原始数据副本上工作并且转换复制的数据。

Calculate Parameters in Calc

您也可以使用以下的 Calc 函数计算参数。

线性回归方程式

线性回归遵循如下方程式 y=m*x+b

m = SLOPE(Data_Y;Data_X)

b = INTERCEPT(Data_Y ;Data_X)

计算决定系数通过

r2 = RSQ(Data_Y;Data_X)

Besides m, b and r2 the array function LINEST provides additional statistics for a regression analysis.

The logarithmic regression equation

The logarithmic regression follows the equation y=a*ln(x)+b.

a = SLOPE(Data_Y;LN(Data_X))

b = INTERCEPT(Data_Y ;LN(Data_X))

r2 = RSQ(Data_Y;LN(Data_X))

指数回归方程式

对于指数回归曲线,转换产生了线性模型。最佳拟合曲线与线性模型相关,且结果被相应解释。

The exponential regression follows the equation y=b*exp(a*x) or y=b*mx, which is transformed to ln(y)=ln(b)+a*x or ln(y)=ln(b)+ln(m)*x respectively.

a = SLOPE(LN(Data_Y);Data_X)

第二变分的变量计算如下:

m = EXP(SLOPE(LN(Data_Y);Data_X))

b = EXP(INTERCEPT(LN(Data_Y);Data_X))

计算决定系数通过

r2 = RSQ(LN(Data_Y);Data_X)

Besides m, b and r2 the array function LOGEST provides additional statistics for a regression analysis.

幂回归方程式

For power regression curves a transformation to a linear model takes place. The power regression follows the equation y=b*xa, which is transformed to ln(y)=ln(b)+a*ln(x).

a = SLOPE(LN(Data_Y);LN(Data_X))

b = EXP(INTERCEPT(LN(Data_Y);LN(Data_X))

r2 = RSQ(LN(Data_Y);LN(Data_X))

多项式回归方程式

For polynomial regression curves a transformation to a linear model takes place.

Create a table with the columns x, x2, x3, … , xn, y up to the desired degree n.

Use the formula =LINEST(Data_Y,Data_X) with the complete range x to xn (without headings) as Data_X.

The first row of the LINEST output contains the coefficients of the regression polynomial, with the coefficient of xn at the leftmost position.

The first element of the third row of the LINEST output is the value of r2. See the LINEST function for details on proper use and an explanation of the other output parameters.

X/Y Error Bars

LINEST function

LOGEST function

SLOPE function

INTERCEPT function

RSQ function