Linear regression
From Wikipedia, the free encyclopedia
| It has been suggested that Linear model be merged into this article or section. (Discuss) |
In statistics, linear regression refers to any approach to modeling the relationship between one or more variables denoted y and one or more variables denoted X, such that the model depends linearly on the unknown parameters to be estimated from the data. Most commonly, linear regression refers to a model in which the conditional mean of y given the value of X is an affine function of X. Less commonly, linear regression could refer to a model in which the median, or some other quantile of the conditional distribution of y given X is expressed as a linear function of X. Like all forms of regression analysis, linear regression focuses on the conditional probability distribution of y given X, rather than on the joint probability distribution of y and X, which is the domain of multivariate analysis.
Linear regression was the first type of regression analysis to be studied rigorously, and to be used extensively in practical applications. The reason for this is that models that depend linearly on their unknown parameters are easier to fit than models that are related non-linearly to their parameters, and the statistical properties of the resulting estimators are easier to determine.
Linear regression has many practical uses. Most applications of linear regression fall into one of the following two broad categories:
- If the goal is prediction, or forecasting, linear regression can be used to fit a predictive model to an observed data set of y and X values. After developing such a model, if an additional value of X is then given without its accompanying value of y, the fitted model can be used to make a prediction of the value of y.
- If we have a variable y and a number of variables X1, ..., Xp that may be related to y, we can use linear regression analysis to quantify the strength of the relationship between y and the Xj, to assess which Xj may have no relationship with y at all, and to identify which subsets of the Xj contain redundant information about y, so that once one of them is known, the others are no longer informative.
Linear regression models are often fit using the least squares approach, but may also be fit in other ways, such as by minimizing the "lack of fit" in some other norm, or by minimizing a penalized version of the least squares loss function as in ridge regression. Conversely, the least squares approach can be used to fit models that are not linear models. Thus, while the terms "least squares" and linear model are closely linked, they are not synonymous.
Contents |
[edit] Introduction
Given a data set
of n statistical units, a linear regression model assumes that the relationship between the dependent variable yi and the p-vector of regressors xi is approximately linear. This approximate relationship is modeled through a so-called “disturbance term” εi — an unobserved random variable that adds noise to the linear relationship between the dependent variable and regressors. Thus the model takes the form
where xi'β is the inner product between vectors xi and β.
Often these n equations are stacked together and written in vector form as
where
Some remarks on terminology and general use:
is called the regressand, dependent variable, endogenous variable, response variable, or measured variable. The decision as to which variable in a data set is modeled as the dependent variable and which are modeled as the independent variables may be based on an presumption that the value of one of the variables is caused by, or directly influenced by the other variables. Alternatively, there may be an operational reason to model one of the variables in terms of the others, in which case there need be no presumption of causality.
are called regressors, exogenous variables, explanatory variables, covariates, input variables, predictor variables, or independent variables (not to be confused with independent random variables). The matrix X is sometimes called the design matrix.
- Usually a constant is included as one of the regressors. For example we can take xi1 = 1 for i = 1, ..., n. The corresponding element of β is called the intercept. Many statistical inference procedures for linear models require an intercept to be present, so it is often included even if theoretical considerations suggest that its value should be zero.
- Sometimes one of the regressors can be a non-linear function of another regressor or of the data, as in polynomial regression and segmented regression. The model remains linear as long as it is linear in the parameter vector β.
- The regressors xi may be viewed either as random variables, which we simply observe, or they can be considered as predetermined fixed values which we can choose. Both interpretations may be appropriate in different cases, and they generally lead to the same estimation procedures; however different approaches to asymptotic analysis are used in these two situations.
is a p-dimensional parameter vector. Its elements are also called effects, or regression coefficients. Statistical estimation and inference in linear regression focuses on β.
is called the error term, disturbance term, or noise. This variable captures all other factors which influence the dependent variable yi other than the regressors xi . The relationship between the error term and the regressors, for example whether they are correlated, is a crucial step in formulating a linear regression model, as it will determine the method to use for estimation.
Example. Consider a situation where a small ball is thrown upwards and then we measure its heights of ascent hi at various times ti. From physics we know that, ignoring the drag, the relationship can be modeled as
where β1 determines the initial velocity of the ball, β2 is proportional to standard gravity, and
is due to measurement errors. Linear regression can be used to estimate the values of β1 and β2 from the measured data. This model is non-linear in the time variable, but it is linear in the parameters β1 and β2. If we take regressors xi = (xi1, xi2) = (ti, ti2), the model has the standard form 
[edit] Assumptions
Two key assumptions are common to all estimation methods used in linear regression analysis:
- The design matrix X must have full column rank p. Otherwise the parameter vector β will not be identified — at most we will be able to narrow down its value to some linear subspace of
. For this property to hold, we must have n > p, where n is the sample size. Methods for fitting linear models with p > n have been developed, but require additional assumptions such as "effect sparsity" — that a large fraction of the effects are exactly zero.
- The regressors xi are assumed to be error-free, that is they are not contaminated with measurement errors. Although not realistic in many settings, dropping this assumption leads to significantly more difficult errors-in-variables models.
Beyond these two assumptions, several other statistical properties of the data strongly influence the performance of different estimation methods:
- Some estimation methods are based on a lack of correlation, among the n observations
. Statistical independence of the observations is not needed, although it can be exploited if it is known to hold.
- The statistical relationship between the error terms and the regressors plays an important role in determining whether an estimation procedure has desirable sampling properties such as being unbiased and consistent.
- The arrangement, or probability distribution of the predictor variables x has a major influence on the precision of estimates of β. Sampling and design of experiments are highly-developed subfields of statistics that provide guidance for collecting data in such a way to achieve a precise estimate of β.
[edit] Estimation methods
Numerous procedures have been developed for parameter estimation and inference in linear regression. These methods differ in computational simplicity of algorithms, presence of a closed-form solution, robustness with respect to heavy-tailed distributions, and theoretical assumptions needed to validate desirable statistical properties such as consistency and asymptotic efficiency. In general, the more restrictive non-parametric assumptions may be imposed on the distribution of error terms
, the more challenging it becomes to construct an efficient estimator which would use all the available information.[citation needed]
Some of the more common estimation techniques for linear regression are summarized below.
- Ordinary Least Squares (OLS) is the simplest and thus very common estimator. It is conceptually simple, and computationally straightforward. OLS estimates are commonly used to analyze both experimental and observational data.
The OLS method minimizes the sum of squared residuals, and leads to a closed-form expression for the estimated value of the unknown parameter β:
In simple linear regression, where there is only one regressor (with a constant), the OLS coefficient estimates have a simple form that is closely related to the correlation coefficient between the covariate and the response.
- Generalized Least Squares (GLS) is an extension of OLS method, that allows efficient estimation when either heteroscedasticity, or correlations, or both are present among the error terms of the model, as long as the form of heteroscedasticity and correlation is known independently of the data. To handle heteroscedasticity when the error terms are uncorrelated with each other, GLS minimizes a weighted analogue to the sum of squared residuals from OLS regression, where the weight for the ith case is inversely proportional to var(εi). This special case of GLS is called “weighted least squares”. The GLS solution to estimation problem is
- Iteratively reweighted least squares (IRLS) is used when heteroscedasticity, or correlations, or both are present among the error terms of the model, but where little is known about the covariance structure of the errors independently of the data[2]. In the first iteration, OLS, or GLS with a provisional covariance structure is carried out, and the residuals are obtained from the fit. Based on the residuals, an improved estimate of the covariance structure of the errors can usually be obtained. A subsequent GLS iteration is then performed using this estimate of the error structure to define the weights. The process can be iterated to convergence, but in many cases, only one iteration is sufficient to achieve an efficient estimate of β.[3][4]
- Instrumental variables regression (IV) can be performed when the regressors are correlated with the errors. In this case, we need the existence of some auxiliary instrumental variables zi such that E(ziεi) = 0.
- Optimal instruments regression is an extension of classical IV regression to the situation where E(εi|zi) = 0.
- Mixed models are widely used to analyze linear regression relationships involving dependent data when the dependencies have a known structure. Common applications of mixed models include analysis of data involving repeated measurements, such as longitudinal data, or data obtained from cluster sampling. They are generally fit as parametric models, using maximum likelihood or Bayesian estimation. In the case where the errors are modeled as normal random variables, there is a close connection between mixed models and generalized least squares[5]. Fixed effects estimation is an alternative approach to analyzing this type of data.
- Principal component regression (PCR) [6][7] is used when the number of predictor variables is large, or when strong correlations exist among the predictor variables. It is a two-stage procedure that first reduces the predictor variables using principal component analysis, then uses the reduced variables in an OLS regression fit. While it often works well in practice, there is no general theoretical reason that the most informative linear function of the predictor variables should lie among the dominant principal components of the multivariate distribution of the predictor variables.
- Maximum likelihood estimation can be performed when the distribution of the error terms is known to belong to a certain parametric family ƒθ of probability distributions[8]. When fθ is a normal distribution with mean zero and variance θ, the resulting estimate is identical to the OLS estimate. GLS estimates are maximum likelihood estimates when ε follows a multivariate normal distribution with a known covariance matrix.
- If we assume that error terms are independent from the regressors
, the optimal estimator is the 2-step MLE, where the first step is used to non-parametrically estimate the distribution of the error term.[citation needed]
- Total least squares (TLS) [9] is an approach to least squares estimation of the linear regression model that treats the covariates and response variable in a more geometrically symmetric manner than OLS. It is one approach to handling the "errors in variables" problem, and is sometimes used when the covariates are assumed to be error-free..
- Ridge regression[10][11][12], and other forms of penalized estimation such as the Lasso[13], deliberately introduce bias into the estimation of β in order to reduce the variability of the estimate. The resulting estimators generally have lower mean squared error than the OLS estimates, particularly when multicollinearity is present. They are generally used when the goal is to predict the value of the response variable y for values of the predictors x that have not yet been observed. These methods are not as commonly used when the goal is inference, since it is difficult to account for the bias.
- "Least angle regression" [14] is an estimation procedure for linear regression models that was developed to handle high-dimensional covariate vectors, potentially with more covariates than observations.
- Least absolute deviation (LAD) regression is a robust estimation technique in that it is less sensitive to the presence of outliers than OLS (but is less efficient than OLS when no outliers are present). It is equivalent to maximum likelihood estimation under a Laplace distribution model for ε[15].
- Besides LAD, other robust estimation techniques including the α-trimmed mean approach, and L-, M-, S-, and R-estimators have been introduced.
[edit] Extensions
| This section requires expansion. |
- In multivariate linear regression, the response variable y is multivariate. Conditional linearity of E(y|x) = Bx is still assumed, with a matrix B replacing the vector β of the classical linear regression model. Multivariate analogues of OLS and GLS have been developed. Alternatively, partial least squares regression can be used to fit multivariate linear regression models.
- Hierarchical linear models (or multilevel regression) organizes the data into a hierarchy of regressions, for example where A is regressed on B, and B is regressed on C. It is often used where the data have a natural hierarchical structure such as in educational statistics, where students are nested in classrooms, classrooms are nested in schools, and schools are nested in some administrative grouping such as a school district. The response variable might be a measure of student achievement such as a test score, and different covariates would be collected at the classroom, school, and school district levels.
- Generalized linear models are a framework for modeling a response variable y in terms of a linear predictor β′x of the regressors x. They are useful for modeling domain-restricted response data such as binary data and count data, where the additive model y = β′x + ε cannot be used.
- In "single index regression," the response variable y is modeled in the form g(β′x) + ε, where g is an arbitrary real-valued function. Single index models allow some degree of nonlinearity in the relationship between x and y, while preserving the central role of the linear predictor β′x as in the classical linear regression model. Under certain conditions, simply applying OLS to data from a single-index model will consistently estimate β up to a proportionality constant [16].
[edit] Applications of linear regression
Linear regression is widely used in biological, behavioral and social sciences to describe possible relationships between variables. It ranks as one of the most important tools used in these disciplines.
[edit] Trend line
- For trend lines as used in technical analysis, see Trend lines (technical analysis)
A trend line represents a trend, the long-term movement in time series data after other components have been accounted for. It tells whether a particular data set (say GDP, oil prices or stock prices) have increased or decreased over the period of time. A trend line could simply be drawn by eye through a set of data points, but more properly their position and slope is calculated using statistical techniques like linear regression. Trend lines typically are straight lines, although some variations use higher degree polynomials depending on the degree of curvature desired in the line.
Trend lines are sometimes used in business analytics to show changes in data over time. This has the advantage of being simple. Trend lines are often used to argue that a particular action or event (such as training, or an advertising campaign) caused observed changes at a point in time. This is a simple technique, and does not require a control group, experimental design, or a sophisticated analysis technique. However, it suffers from a lack of scientific validity in cases where other potential changes can affect the data.
[edit] Epidemiology
As one example, early evidence relating tobacco smoking to mortality and morbidity came from studies employing regression. Researchers usually include several variables in their regression analysis in an effort to remove factors that might produce spurious correlations. For the cigarette smoking example, researchers might include socio-economic status in addition to smoking to ensure that any observed effect of smoking on mortality is not due to some effect of education or income. However, it is never possible to include all possible confounding variables in a study employing regression. For the smoking example, a hypothetical gene might increase mortality and also cause people to smoke more. For this reason, randomized controlled trials are often able to generate more compelling evidence of causal relationships than correlational analysis using linear regression. When controlled experiments are not feasible, variants of regression analysis such as instrumental variables and other methods may be used to attempt to estimate causal relationships from observational data.
[edit] Finance
The capital asset pricing model uses linear regression as well as the concept of Beta for analyzing and quantifying the systematic risk of an investment. This comes directly from the Beta coefficient of the linear regression model that relates the return on the investment to the return on all risky assets.
Regression may not be the appropriate way to estimate beta in finance given that it is supposed to provide the volatility of an investment relative to the volatility of the market as a whole. This would require that both these variables be treated in the same way when estimating the slope. Whereas regression treats all variability as being in the investment returns variable, i.e. it only considers residuals in the dependent variable.[17]
[edit] Environmental science
Linear regression finds application in a wide range of environmental science applications.
[edit] See also
| Wikiversity has learning materials about Multiple linear regression |
- ANOVA, or analysis of variance, is historically a precursor to the development of linear models. Here the model parameters themselves are not computed, but X column contributions and their significance are identified using the ratios of within-group variances to the error variance and applying the F test.
- Anscombe's quartet
- Cross-sectional regression
- Curve fitting
- Empirical Bayes methods
- Least-squares estimation of linear regression coefficients
- M-estimator
- Nonlinear regression
- Nonparametric regression
- Multivariate adaptive regression splines
- Lack-of-fit sum of squares
- Truncated regression model
- Censored regression model
[edit] Notes
- ^ Lai, T.L.; Robbins,H; Wei, C.Z. (1978). "Strong consistency of least squares estimates in multiple regression". Proceedings of the National Academy of Sciences USA 75 (7).
- ^ del Pino, Guido (1989). "The Unifying Role of Iterative Generalized Least Squares in Statistical Algorithms". Statistical Science 4 (4): 394–403. http://www.jstor.org/stable/2245853.
- ^ Carroll, Raymond J. (1982). "Adapting for Heteroscedasticity in Linear Models". The Annals of Statistics 10 (4): 1224–1233. http://www.jstor.org/stable/2240725.
- ^ Cohen, Michael; Dalal, Siddhartha R.; Tukey,John W. (1993). "Robust, Smoothly Heterogeneous Variance Regression". Journal of the Royal Statistical Society. Series C (Applied Statistics) 42 (2): 339–353. http://www.jstor.org/stable/2986237.
- ^ Goldstein, H. (1986). "Multilevel Mixed Linear Model Analysis Using Iterative Generalized Least Squares". Biometrika 73 (1): 43–56. http://www.jstor.org/stable/2336270.
- ^ Jolliffe, Ian T. (1982). "A Note on the Use of Principal Components in Regression". Journal of the Royal Statistical Society. Series C (Applied Statistics) 31 (3): 300–303. http://www.jstor.org/stable/2348005.
- ^ Hawkins, Douglas M. (1973). "On the Investigation of Alternative Regressions by Principal Component Analysis". Journal of the Royal Statistical Society. Series C (Applied Statistics) 22 (3): 275–286. http://www.jstor.org/stable/2346776.
- ^ Lange, Kenneth L.; Little, Roderick J. A.; Taylor,Jeremy M. G. (1989). "Robust Statistical Modeling Using the t Distribution". Journal of the American Statistical Association 84 (408): 881–896. http://www.jstor.org/stable/2290063.
- ^ Nievergelt, Yves (1994). "Total Least Squares: State-of-the-Art Regression in Numerical Analysis". SIAM Review 36 (2): 258–264. http://www.jstor.org/stable/2132463.
- ^ Swindel, Benee F. (1981). "Geometry of Ridge Regression Illustrated". The American Statistician 35 (1): 12–15. http://www.jstor.org/stable/2683577.
- ^ Draper, Norman R.; van Nostrand,R. Craig (1979). "Ridge Regression and James-Stein Estimation: Review and Comments". Technometrics 21 (4): 451–466. http://www.jstor.org/stable/1268284.
- ^ Hoerl, Arthur E.; Kennard,Robert W.; Hoerl,Roger W. (1985). "Practical Use of Ridge Regression: A Challenge Met". Journal of the Royal Statistical Society. Series C (Applied Statistics) 34 (2): 114–120. http://www.jstor.org/stable/2347363.
- ^ Tibshirani, Robert (1996). "Regression Shrinkage and Selection via the Lasso". Journal of the Royal Statistical Society. Series B (Methodological) 58 (1): 267–288. http://www.jstor.org/stable/2346178.
- ^ Efron, Bradley; Hastie,Trevor; Johnstone,Iain Johnstone;Tibshirani,Robert (2004). "Least Angle Regression". The Annals of Statistics 32 (2): 407–451. http://www.jstor.org/stable/3448465.
- ^ Narula, Subhash C.; Wellington, John F. (1982). "The Minimum Sum of Absolute Errors Regression: A State of the Art Survey". International Statistical Review 50 (3): 317–326. http://www.jstor.org/stable/1402501.
- ^ Brillinger, David R. (1977). "The Identification of a Particular Nonlinear Time Series System". Biometrika 64 (3): 509–515. http://www.jstor.org/stable/2345326.
- ^ Tofallis, C. (2008). "Investment Volatility: A Critique of Standard Beta Estimation and a Simple Way Forward". European Journal of Operational Research 187: 1358. doi:. http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1076742.
[edit] References
- Cohen, J., Cohen P., West, S.G., & Aiken, L.S. (2003). Applied multiple regression/correlation analysis for the behavioral sciences. (2nd ed.) Hillsdale, NJ: Lawrence Erlbaum Associates
- Charles Darwin. The Variation of Animals and Plants under Domestication. (1869) (Chapter XIII describes what was known about reversion in Galton's time. Darwin uses the term "reversion".)
- Draper, N.R. and Smith, H. Applied Regression Analysis Wiley Series in Probability and Statistics (1998)
- Francis Galton. "Regression Towards Mediocrity in Hereditary Stature," Journal of the Anthropological Institute, 15:246-263 (1886). (Facsimile at: [1])
- Robert S. Pindyck and Daniel L. Rubinfeld (1998, 4h ed.). Econometric Models and Economic Forecasts,, ch. 1 (Intro, incl. appendices on Σ operators & derivation of parameter est.) & Appendix 4.3 (mult. regression in matrix form).
- Kaw, Autar; Kalu, Egwu (2008), Numerical Methods with Applications (1st ed.), [2], Chapter 6 deals with linear and non-linear regression.
[edit] External links
- http://homepage.mac.com/nshoffner/nsh/CalcBookAll/Chapter%201/1functions.html
- Investment Volatility: A Critique of Standard Beta Estimation and a Simple Way Forward, C.TofallisDownloadable version of paper, subsequently published in the European Journal of Operational Research 2008.
- Scale-adaptive nonparametric regression (with Matlab software).
- In Situ Adaptive Tabulation: Combining many linear regressions to approximate any nonlinear function.
- Earliest Known uses of some of the Words of Mathematics. See: [3] for "error", [4] for "Gauss-Markov theorem", [5] for "method of least squares", and [6] for "regression".
- Perpendicular Regression Of a Line at MathPages
- Online regression by eye (simulation).
- Leverage Effect Interactive simulation to show the effect of outliers on the regression results
- Linear regression as an optimisation problem
- Visual Statistics with Multimedia
- Multiple Regression by Elmer G. Wiens. Online multiple and restricted multiple regression package.
- CAUSEweb.org Many resources for teaching statistics including Linear Regression.
- [7] "Mahler's Guide to Regression"
- Linear Regression - Notes, PPT, Videos, Mathcad, Matlab, Mathematica, Maple at Numerical Methods for STEM undergraduate
- Restricted regression - Lecture in the Department of Statistics, University of Udine
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||





![\operatorname{E}[\,x_i\varepsilon_i\,] = 0.](http://upload.wikimedia.org/math/4/f/8/4f85045d7e373d4a4aed16b558e503cf.png)


