Linear regression analysis using the Ordinary Least Squares (OLS) method…