Linear regression is widely used to model the relationship between response or dependent variable and explanatory or independent variables. The…