Liñas de tendencia
Pódense engadir liñas de tendencia a todos os tipos de gráficas en 2D, excepto as de sector e de cotizacións
Se insire unha liña de tendencia nun tipo de gráfico que empregue categorías, como Liña ou Columna, os números 1, 2, 3, ... emprégase como valores de x para calcular a liña de tendencia. Para estas gráficas o tipo de gráfica XY podería ir mellor.
-
Para inserir unha liña de tendencia dunha serie de datos, seleccione a serie de datos na gráfica. Escolla
ou prema do botón dereito para abrir o menú de contexto eescolla . -
As liñas de valor medio son liñas de tendencia especiais que mostran o valor medio. Empregue
par inserir liñas de valor medio de series de datos. -
Para eliminar unha liña de tendencia ou unha liña de valor medio prema na liña e a seguir na tecla Suprimir.
Na lenda móstrase automaticamente unha liña de tendencia. Pódese definir o seu nome nas opcións da liña de tendencia.
A liña de tendencia ten a mesma cor que a serie de datos correspondente. Para cambiar as propiedades da liña, seleccione a liña de tendencia e escolla
Ecuación de liña de tendencia e coeficiente de determinación
Ao ter unha gráfica no modo de edición, o LibreOffice dá a ecuación da liña de tendencia e o coeficiente de determinación R2, mesmo se non se mostran: prema na liña de tendencia para ver a información na barra de estado.
To show the trend line equation, select the trend line in the chart, right-click to open the context menu, and choose .
Para cambiar o formato dos valores (empregar díxitos menos significativos ou notación científica), seleccione a ecuación na gráfica, prema co botón dereito do rato para abrir o menú de contexto e escolla
.Default equation uses x for abscissa variable, and f(x) for ordinate variable. To change these names, select the trend line, choose 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
.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.
Trend Lines Curve Types
Están dispoñíbeis os tipos de regresión seguintes:
-
Linear trend line: regression through equation y=a∙x+b. Intercept b can be forced.
-
Polynomial trend line: regression through equation y=Σi(ai∙xi). Intercept a0 can be forced. Degree of polynomial must be given (at least 2).
-
Logarithmic trend line: regression through equation y=a∙ln(x)+b.
-
Exponential trend line: regression through equation y=b∙exp(a∙x).This equation is equivalent to y=b∙mx with m=exp(a). Intercept b can be forced.
-
Power trend line: regression through equation y=b∙xa.
-
Moving average trend line: simple moving average is calculated with the n previous y-values, n being the period. No equation is available for this trend line.
Restricións
O cálculo da liña de tendencia considera só pares de datos cos valores seguintes:
-
Liña de tendencia logarítmica: só se consideran valores positivos de x.
-
Liña de tendencia exponencial: só se consideran valores de y positivos, excepto se todos os valores de y foren negativos: neste caso a regresión sigue a ecuación seguinte y=-b∙exp(a∙x).
-
Power trend line: only positive x-values are considered; only positive y-values are considered, except if all y-values are negative: regression will then follow equation y=-b∙xa.
Ten que transformar os seus datos de acordo con isto; é mellor traballar cunha copia dos datos orixinais e transformar os datos copiados.
Calcular parámetros no Calc
Tamén pode calcular os parámetros empregando as funcións do Calc como segue.
A ecuación de regresión lineal
A regresión lineal segue a ecuación y=m*x+b.
m = SLOPE(Data_Y;Data_X)
b = INTERCEPT(Data_Y ;Data_X)
Calculate the coefficient of determination by
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))
A ecuación de regresión exponencial
For exponential trend lines a transformation to a linear model takes place. The optimal curve fitting is related to the linear model and the results are interpreted accordingly.
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)
The variables for the second variation are calculated as follows:
m = EXP(SLOPE(LN(Data_Y);Data_X))
b = EXP(INTERCEPT(LN(Data_Y);Data_X))
Calculate the coefficient of determination by
r2 = RSQ(LN(Data_Y);Data_X)
Besides m, b and r2 the array function LOGEST provides additional statistics for a regression analysis.
The power regression equation
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))
A ecuación de regresión polinomial
Para curvas de regresión polinomial realízase unha transformación a un modelo lineal.
Crear unha táboa coas columnas x, x2, x3, … , xn, y até o grao desexado 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.