Multivariate linear regression
In multiple linear regression, we try to explain the dependent variable in terms of more than one predictor variable. The multiple linear regression equation is given by the following formula:
Here are multiple linear regression parameters and can be obtained by minimizing the sum of squares, which is also known as the OLS method of estimation.
Let us an take an example where we have the dependent variable StockYPrice
and we are trying to predict it in terms of independent variables StockX1Price
, StockX2Price
, StockX3Price
, and StockX4Price
, which are present in the dataset DataMR
.
Now let us fit the multiple regression model and get parameter estimates of multiple regression:
> MultipleR.lm = lm(StockYPrice ~ StockX1Price + StockX2Price + StockX3Price + StockX4Price, data=DataMR) > summary(MultipleR.lm)
When we execute the preceding code, it fits the multiple regression model on the data and gives the basic summary of statistics associated with multiple...