Topic 7 Linear Regression
Introduction
Regression analysis is one of the most widely used tool in quantitative research which is used to analyse the relationship between variables.
One or more variables are considered to be explanatory variables, and the other is considered to be the dependent variable.
In general linear regression is used to predict a continuous dependent variable (regressand) from a number of independent variables (regressors) assuming that the relationship between the dependent and independent variables is linear.
If we have a dependent (or response) variable Y which is related to a predictor variables \(X_{i}\). The simple regression model is given by
\[\begin{equation} Y=\alpha+\beta X_{i}+\epsilon_{i} \tag{7.1} \end{equation}\]
R has the function \(\mathtt{lm}\) (linear model) for linear regression.
The main arguments to the function \(\mathtt{lm}\) are a formula and the data. \(\mathtt{lm}\) takes the defining model input as a formula
A formula object is also used in other statistical function like \(\mathtt{glm,\,nls,\,rq}\) etc, which is from a formula class.