Performing a multiple regression analysis
Multiple regression analysis can be regarded as an extension of simple linear regression. One can use multiple regression analysis to predict the value of a dependent variable based on multiple independent variables. In the following recipe, we demonstrate how to predict house rental prices with multiple variables.
One needs to have completed the previous recipe by downloading the house rental data into a variable
How to do it…
Perform the following steps to fit the house rental dataset into a multiple regression model:
- First, you need to fit
Bathroominto a linear regression model:
> fit <- lm(Price ~ Sqft + Floor + TotalFloor + Bedroom ...