Mathematical Foundations
4.1 Concept of Independent and Dependent Variables
In linear regression, variables play distinct roles and are categorized as independent or dependent:
-
Dependent Variable (Response): The variable we want to predict or explain. In the context of regression, it is denoted by .
-
Independent Variables (Predictors): The variables we use to make predictions about the dependent variable. They are denoted by . The premise is that these variables directly influence the value of .
The relationship between the variables is expressed by a linear equation, in which the value of is computed based on the independent variables.
4.2 Linear Function and the Equation of a Line
A linear function is a mathematical expression that describes a straight line. In its simplest form, for a single independent variable, the equation of a line is:
where:
-
is the intercept, representing the point where the line crosses the -axis.
-
is the slope coefficient, indicating the steepness of the line—that is, how changes as changes.
For multiple independent variables, the equation expands to:
This equation represents a hyperplane in -dimensional space, where each coefficient shapes the orientation of the hyperplane.
4.3 The Method of Least Squares
The method of least squares is a technique used to estimate the coefficients that minimize the sum of the squared differences between the observed values and the predicted values :
where:
-
is the observed value;
-
is the value predicted by the regression equation.
The goal is to find the values of that minimize the SSR, leading to the line of best fit. The solution to this optimization problem is given by the formula:
where is the data matrix including the constant term, is the transpose of , and is the vector of response values.
4.4 Regression Coefficients and Interpretation
Regression coefficients are essential for interpreting a linear model. Each coefficient represents the expected change in the dependent variable for a one-unit change in the independent variable , holding all other variables constant.
-
Intercept (): Indicates the expected value of when all independent variables are equal to zero.
-
Coefficients (): Represent the slope of the hyperplane with respect to each independent variable. A positive coefficient suggests that an increase in the independent variable leads to an increase in , whereas a negative coefficient suggests the opposite.
It is important to examine the statistical significance of each coefficient, often using -tests, to determine whether the relationship between the variables is genuinely significant or merely due to chance.