HOME

TheInfoList



OR:

Linear trend estimation is a
statistical Statistics (from German language, German: ', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a s ...
technique used to analyze
data Data ( , ) are a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted for ...
patterns.
Data Data ( , ) are a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted for ...
patterns, or trends, occur when the
information Information is an Abstraction, abstract concept that refers to something which has the power Communication, to inform. At the most fundamental level, it pertains to the Interpretation (philosophy), interpretation (perhaps Interpretation (log ...
gathered tends to increase or decrease over time or is influenced by changes in an external factor. Linear trend estimation essentially creates a straight line on a graph of
data Data ( , ) are a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted for ...
that models the general direction that the
data Data ( , ) are a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted for ...
is heading.


Fitting a trend: Least-squares

Given a set of
data Data ( , ) are a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted for ...
, there are a variety of functions that can be chosen to fit the data. The simplest function is a straight line with the dependent variable (typically the measured data) on the vertical axis and the independent variable (often time) on the horizontal axis. The least-squares fit is a common method to fit a straight line through the data. This method minimizes the sum of the squared errors in the data series y. Given a set of points in time t and data values y_t observed for those points in time, values of \hat a and \hat b are chosen to minimize the sum of squared errors :\sum_t \left y_t - \left( \hatt + \hat \right) \right2. This formula first calculates the difference between the observed data y_t and the estimate (\hatt + \hat), the difference at each data point is squared, and then added together, giving the "sum of squares" measurement of error. The values of \hat and \hat derived from the data parameterize the simple linear estimator \hat = \hat x + \hat. The term "trend" refers to the slope \hat in the least squares estimator.


Data as trend and noise

To analyze a (time) series of data, it can be assumed that it may be represented as trend plus noise: :y_t = at + b + e_t\, where a and b are unknown constants and the e's are randomly distributed errors. If one can reject the null hypothesis that the errors are non-stationary, then the non-stationary series \ is called trend-stationary. The least-squares method assumes the errors are independently distributed with a normal distribution. If this is not the case, hypothesis tests about the unknown parameters a and b may be inaccurate. It is simplest if the e's all have the same distribution, but if not (if some have higher variance, meaning that those data points are effectively less certain), then this can be taken into account during the least-squares fitting by weighting each point by the inverse of the variance of that point. Commonly, where only a single time series exists to be analyzed, the variance of the e's is estimated by fitting a trend to obtain the estimated parameter values \hat a and \hat b, thus allowing the predicted values :\hat y =\hat at+\hat b to be subtracted from the data y_t (thus ''detrending'' the data), leaving the residuals \hat e_t as the ''detrended data'', and estimating the variance of the e_t's from the residuals — this is often the only way of estimating the variance of the e_t's. Once the "noise" of the series is known, the significance of the trend can be assessed by making the
null hypothesis The null hypothesis (often denoted ''H''0) is the claim in scientific research that the effect being studied does not exist. The null hypothesis can also be described as the hypothesis in which no relationship exists between two sets of data o ...
that the trend, a, is not different from 0. From the above discussion of trends in random data with known
variance In probability theory and statistics, variance is the expected value of the squared deviation from the mean of a random variable. The standard deviation (SD) is obtained as the square root of the variance. Variance is a measure of dispersion ...
, the distribution of calculated trends is to be expected from random (trendless) data. If the estimated trend, \hat a, is larger than the critical value for a certain significance level, then the estimated trend is deemed significantly different from zero at that significance level, and the null hypothesis of a zero underlying trend is rejected. The use of a linear trend line has been the subject of criticism, leading to a search for alternative approaches to avoid its use in model estimation. One of the alternative approaches involves
unit root In probability theory and statistics, a unit root is a feature of some stochastic processes (such as random walks) that can cause problems in statistical inference involving time series models. A linear stochastic process has a unit root if ...
tests and the cointegration technique in econometric studies. The estimated coefficient associated with a linear trend variable such as time is interpreted as a measure of the impact of a number of unknown or known but immeasurable factors on the dependent variable over one unit of time. Strictly speaking, this interpretation is applicable for the estimation time frame only. Outside of this time frame, it cannot be determined how these immeasurable factors behave both qualitatively and quantitatively. Research results by mathematicians, statisticians, econometricians, and economists have been published in response to those questions. For example, detailed notes on the meaning of linear time trends in the regression model are given in Cameron (2005); Granger, Engle, and many other econometricians have written on stationarity, unit root testing, co-integration, and related issues (a summary of some of the works in this area can be found in an information paper by the Royal Swedish Academy of Sciences (2003)); and Ho-Trieu & Tucker (1990) have written on logarithmic time trends with results indicating linear time trends are special cases of cycles.


Noisy time series

It is harder to see a trend in a noisy time series. For example, if the true series is 0, 1, 2, 3, all plus some independent normally distributed "noise" ''e'' of
standard deviation In statistics, the standard deviation is a measure of the amount of variation of the values of a variable about its Expected value, mean. A low standard Deviation (statistics), deviation indicates that the values tend to be close to the mean ( ...
''E'', and a sample series of length 50 is given, then if ''E''=0.1, the trend will be obvious; if ''E''=100, the trend will probably be visible; but if ''E''=10000, the trend will be buried in the noise. Consider a concrete example, such as the global surface temperature record of the past 140 years as presented by the
IPCC The Intergovernmental Panel on Climate Change (IPCC) is an intergovernmental body of the United Nations. Its job is to "provide governments at all levels with scientific information that they can use to develop climate policies". The World M ...
. The interannual variation is about 0.2°C, and the trend is about 0.6°C over 140 years, with 95% confidence limits of 0.2°C (by coincidence, about the same value as the interannual variation). Hence, the trend is statistically different from 0. However, as noted elsewhere, this time series doesn't conform to the assumptions necessary for least-squares to be valid.


Goodness of fit (''r''-squared) and trend

The least-squares fitting process produces a value, r-squared (''r''2), which is 1 minus the ratio of the variance of the residuals to the variance of the dependent variable. It says what fraction of the variance of the data is explained by the fitted trend line. It does not relate to the
statistical significance In statistical hypothesis testing, a result has statistical significance when a result at least as "extreme" would be very infrequent if the null hypothesis were true. More precisely, a study's defined significance level, denoted by \alpha, is the ...
of the trend line (see graph); the statistical significance of the trend is determined by its
t-statistic In statistics, the ''t''-statistic is the ratio of the difference in a number’s estimated value from its assumed value to its standard error. It is used in hypothesis testing via Student's ''t''-test. The ''t''-statistic is used in a ''t''-t ...
. Often, filtering a series increases ''r''2 while making little difference to the fitted trend.


Advanced models

Thus far, the data have been assumed to consist of the trend plus noise, with the noise at each data point being independent and identically distributed random variables with a normal distribution. Real data (for example, climate data) may not fulfill these criteria. This is important, as it makes an enormous difference to the ease with which the statistics can be analyzed so as to extract maximum information from the data series. If there are other non-linear effects that have a
correlation In statistics, correlation or dependence is any statistical relationship, whether causal or not, between two random variables or bivariate data. Although in the broadest sense, "correlation" may indicate any type of association, in statistics ...
to the independent variable (such as cyclic influences), the use of least-squares estimation of the trend is not valid. Also, where the variations are significantly larger than the resulting straight line trend, the choice of start and end points can significantly change the result. That is, the model is mathematically misspecified. Statistical inferences (tests for the presence of a trend, confidence intervals for the trend, etc.) are invalid unless departures from the standard assumptions are properly accounted for, for example, as follows: *Dependence: autocorrelated time series might be modelled using autoregressive moving average models. *Non-constant variance: in the simplest cases, weighted least squares might be used. *Non-normal distribution for errors: in the simplest cases, a
generalized linear model In statistics, a generalized linear model (GLM) is a flexible generalization of ordinary linear regression. The GLM generalizes linear regression by allowing the linear model to be related to the response variable via a ''link function'' and by ...
might be applicable. *
Unit root In probability theory and statistics, a unit root is a feature of some stochastic processes (such as random walks) that can cause problems in statistical inference involving time series models. A linear stochastic process has a unit root if ...
: taking first (or occasionally second) differences of the data, with the level of differencing being identified through various unit root tests. In R, the linear trend in data can be estimated by using the 'tslm' function of the 'forecast' package.


Trends in clinical data

Medical and biomedical studies often seek to determine a link between sets of data, such as of a clinical or scientific metric in three different diseases. But data may also be linked in time (such as change in the effect of a drug from baseline, to month 1, to month 2), or by an external factor that may or may not be determined by the researcher and/or their subject (such as no pain, mild pain, moderate pain, or severe pain). In these cases, one would expect the effect test statistic (e.g., influence of a
statin Statins (or HMG-CoA reductase inhibitors) are a class of medications that lower cholesterol. They are prescribed typically to people who are at high risk of cardiovascular disease. Low-density lipoprotein (LDL) carriers of cholesterol play ...
on levels of
cholesterol Cholesterol is the principal sterol of all higher animals, distributed in body Tissue (biology), tissues, especially the brain and spinal cord, and in Animal fat, animal fats and oils. Cholesterol is biosynthesis, biosynthesized by all anima ...
, an
analgesic An analgesic drug, also called simply an analgesic, antalgic, pain reliever, or painkiller, is any member of the group of drugs used for pain management. Analgesics are conceptually distinct from anesthetics, which temporarily reduce, and in s ...
on the degree of pain, or increasing doses of different strengths of a drug on a measurable index, i.e. a dose - response effect) to change in direct order as the effect develops. Suppose the mean level of cholesterol before and after the prescription of a statin falls from 5.6 mmol/L at baseline to 3.4 mmol/L at one month and to 3.7 mmol/L at two months. Given sufficient power, an ANOVA (analysis of variance) would most likely find a significant fall at one and two months, but the fall is not linear. Furthermore, a post-hoc test may be required. An alternative test may be a repeated measures (two way) ANOVA or Friedman test, depending on the nature of the data. Nevertheless, because the groups are ordered, a standard ANOVA is inappropriate. Should the cholesterol fall from 5.4 to 4.1 to 3.7, there is a clear linear trend. The same principle may be applied to the effects of allele/ genotype frequency, where it could be argued that a
single-nucleotide polymorphism In genetics and bioinformatics, a single-nucleotide polymorphism (SNP ; plural SNPs ) is a germline substitution of a single nucleotide at a specific position in the genome. Although certain definitions require the substitution to be present in a ...
in nucleotides XX, XY, YY are in fact a trend of no Y's, one Y, and then two Y's. The mathematics of linear trend estimation is a variant of the standard ANOVA, giving different information, and would be the most appropriate test if the researchers hypothesize a trend effect in their test statistic. One example is levels of serum
trypsin Trypsin is an enzyme in the first section of the small intestine that starts the digestion of protein molecules by cutting long chains of amino acids into smaller pieces. It is a serine protease from the PA clan superfamily, found in the dig ...
in six groups of subjects ordered by age decade (10–19 years up to 60–69 years). Levels of trypsin (ng/mL) rise in a direct linear trend of 128, 152, 194, 207, 215, 218 (data from Altman). Unsurprisingly, a 'standard' ANOVA gives ''p'' < 0.0001, whereas linear trend estimation gives ''p'' = 0.00006. Incidentally, it could be reasonably argued that as age is a natural continuously variable index, it should not be categorized into decades, and an effect of age and serum trypsin is sought by correlation (assuming the raw data is available). A further example is of a substance measured at four time points in different groups: This is a clear trend. ANOVA gives ''p'' = 0.091, because the overall variance exceeds the means, whereas linear trend estimation gives ''p'' = 0.012. However, should the data have been collected at four time points in the same individuals, linear trend estimation would be inappropriate, and a two-way (repeated measures) ANOVA would have been applied.


See also

*
Estimation Estimation (or estimating) is the process of finding an estimate or approximation, which is a value that is usable for some purpose even if input data may be incomplete, uncertain, or unstable. The value is nonetheless usable because it is d ...
* Extrapolation *
Forecasting Forecasting is the process of making predictions based on past and present data. Later these can be compared with what actually happens. For example, a company might Estimation, estimate their revenue in the next year, then compare it against the ...
* Least squares *
Least-squares spectral analysis Least-squares spectral analysis (LSSA) is a method of estimating a Spectral density estimation#Overview, frequency spectrum based on a least-squares fit of Sine wave, sinusoids to data samples, similar to Fourier analysis. Fourier analysis, the ...
* Line fitting * Prediction interval * Regression analysis


Notes


References

* * * * * * * {{Statistics, analysis Regression with time series structure Statistical forecasting Change detection