Línies de tendència
Podeu afegir línies de tendència a tots els tipus de diagrama 2D, excepte als diagrames de sectors i als diagrames de borsa.
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.
-
To insert a trend line for a data series, select the data series in the chart. Choose
, or right-click to open the context menu, and choose . -
Mean Value Lines are special trend lines that show the mean value. Use
to insert mean value lines for data series. -
To delete a trend line or mean value line, click the line, then press the Del key.
A trend line is shown in the legend automatically. Its name can be defined in options of the trend line.
La línia de tendència és del mateix color que la sèrie de dades corresponent. Per canviar les propietats de la línia, seleccioneu-la i trieu
.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 .
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
.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.
Tipus de corbes de línies de tendència
The following regression types are available:
-
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.
Restriccions
El càlcul de la línia de tendència només té en compte els parells de dades que disposin dels valors següents:
-
Logarithmic trend line: only positive x-values are considered.
-
Exponential trend line: only positive y-values are considered, except if all y-values are negative: regression will then follow equation 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.
És recomanable que transformeu les dades d'acord amb aquestes indicacions; el millor és treballar amb una còpia de les dades originals i transformar aquestes dades copiades.
Calcula els paràmetres en el Calc
També podeu calcular els paràmetres utilitzant les funcions del Calc de la manera següent.
Equació de regressió lineal
La regressió lineal segueix l'equació y=m*x+b.
m = PENDENT(Dades_Y;Dades_X)
b = INTERCEPCIO(Dades_Y ;Dades_X)
Calculeu el coeficient de determinació per
r2 = RSQ(Data_Y;Data_X)
Besides m, b and r2 the array function LINEST provides additional statistics for a regression analysis.
L'equació de regressió logarítmica
La regressió logarítmica segueix l'equació y=a*ln(x)+b.
a = PENDENT(Dades_Y;LN(Dades_X))
b = INTERCEPCIO(Dades_Y ;LN(Dades_X))
r2 = RSQ(Data_Y;LN(Data_X))
Equació de regressió exponencial
Per a les línies de tendència exponencial es produeix una transformació a un model lineal. L'ajustament de corbes òptim està relacionat amb el model lineal i els resultats s'interpreten en conseqüència.
La regressió exponencial segueix les equacions y=b*exp(a*x) o y=b*mx, que es transformen en ln(y)=ln(b)+a*x o ln(y)=ln(b)+ln(m)*x, respectivament.
a = PENDENT(LN(Dades_Y);Dades_X)
Les variables per a la segona variació es calculen de la manera següent:
m = EXP(PENDENT(LN(Dades_Y);Dades_X))
b = EXP(INTERCEPCIO(LN(Dades_Y);Dades_X))
Calculeu el coeficient de determinació per
r2 = RSQ(LN(Data_Y);Data_X)
Besides m, b and r2 the array function LOGEST provides additional statistics for a regression analysis.
Equació de regressió potencial
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 = PENDENT(LN(Dades_Y);LN(Dades_X))
b = EXP(INTERCEPCIO(LN(Dades_Y);LN(Dades_X))
r2 = RSQ(LN(Data_Y);LN(Data_X))
Equació de regressió polinòmica
For polynomial regression curves a transformation to a linear model takes place.
Crea una taula amb les columnes x, x2, x3, ... xn i y fins al grau n desitjat.
Utilitzeu la fórmula =ESTLIN(Dades_Y,Dades_X) amb l'interval complet x a xn (sense encapçalaments) com a Dades_X.
La primera fila del resultat d'ESTLIN conté els coeficients de la regressió polinòmica, en què el coeficient de xn es troba a la posició de més a l'esquerra.
El primer element de la tercera línia del resultat d'ESTLIN és el valor de r2. Vegeu la funció ESTLIN per a conèixer-ne més detalls i altres paràmetres.