"Linear model describes a quantitative response in terms of a linear combination of predictors. You can use a linear model to make predictions or explain the relationship between the response and the predictors. Linear models are very flexible and widely used in applications in physical science, engineering, social science and business." as stated by Julian J. Faraway in his book Linear Models with R.
Linear models are used for explaining the relationship between a single variable Y ( which represents a response or output) and one or more predictors or inputs X1, X2,....Xp (where p represents the number of different predictors).
A general form for the model is:
Y = f(X1, X2,..., Xp ) + ε
where f() represents an unknown function and ε the error of the model.
If we assume that f() is a smooth, continuos function that leaves us with a wide range of possibilities, and with all the data (predictors we are working with) we can collect is not enough to try to estimate f() directly, so we have to use a more restrictive form: linear.
For example, if we are working with 4 predictors:
Y
= f(X1, X2, X3, X4) + ε
we modify the previous infinite function in a linear way, so we get the following linear model:
Y = β0 + β1X1 + β2X2 + β3X3 + β4X4 + ε
A model is lineal if the parameters enter linearly in the equation. For instance, the following equations are linear:
Y = β0 + β1X1 + β2X2 + β3X3 + ε
Y = β0 + β1X1 + β2X2 + β3X32 + ε
Y = β0 + β1X1 + β2 log X2+ ε
Y = β0 + β1X1 + β2X2 + β3X1X2 + ε
Y = β0 + β1X1 + β2X2β3 + ε
Some equations can be transformed to linearity, so linear models are very flexible and are able to handle complex datasets.
When the number of predictors is one it is called Simple Linear Model:
When the number of predictors is one it is called Simple Linear Model:
Y = β0 + β1X1 + ε
and, when there is more than one predictor is called Multiple Linear Model:
Y = β0 + β1X1 + β2X2 + β3X3 + β4X4 + ε
The error is a necessary factor to take into account when working with linear models for the following reasons:
1. Effect of variables not considered in the model
2. Unforeseen events (catastrophes, fashions, etc.)
3. Erors from observations or measurements
Linear models can be used for:
1. Verifying the existence of a linear relationship
2. Predicting the variable Y as a function of X or Xs (X1, X2 ... Xk)