OLS Model Coefficients
Let's learn estimation and interpretation of ordinary least squares (OLS) model coefficients.
What technique should we use to estimate the sample regression model? As noted earlier, we use OLS to find a set of coefficient estimates that minimizes the residual sum of squares. The specific OLS estimator for the vector of coefficients in the sample model, denoted as containing , , , and , can be expressed as follows:
The essence of the formula is that it allows us to find the set of ( , , , and ) that minimizes the residual sum of squares.
The R code for obtaining the OLS coefficient estimates and related output is straightforward. We begin with the lm()
function, which represents a linear model. The argument inside the function includes the dependent variable, followed by a tilde and the independent variables connected by plus sign, and the data=
option for specifying the dataset. Once the model is estimated, the output from the lm()
function is assigned to some object, which we refer to as model1
. To demonstrate the content of the model output, we apply the summary()
function to model1
.
Get hands-on with 1400+ tech skills courses.