Multiple Regression — Octane Rating Prediction

Generate an OLS model with all main effects included. Perform standard regression diagnostics on this model. What can you conclude?

Following are the coefficients and the intercepts calculated using the linear regression model (OLS).

Intercept 96.27422785026842
Material1 -0.096111
Material2 -0.126626
Material3 -0.026994
Condition 1.905263
Mean Absolute Error: 0.4355744480702062
Mean Squared Error: 0.25699821227022623
Root Mean Squared Error test: 0.506949911007218
R Squared test: 0.8969403057107406
Root Mean Squared Error train: 0.40881534712587425
R Squared train: 0.906540864451247

Regression Diagnostics:

Linear relationship:

Next, generate a subset model with the least significant main effect excluded. Compare these two models using all the model comparison techniques applicable. What can you conclude?

From the OLS model using Statsmodel and observing the p-values –

Model 2 (subset model)
Intercept 94.22624576667697
Material1 -0.097790
Material2 -0.122025
Condition 2.301843
Mean Absolute Error: 0.42864602044174327
Mean Squared Error: 0.25391471478981115
Root Mean Squared Error test: 0.5038995086223156
R Squared test: 0.8981768291280285
Root Mean Squared Error train: 0.4209239432690823
R Squared train: 0.9009225915902364

If your goal was to produce gasoline at an octane rating of 95, pick one set of operating conditions that would do so. Make sure that this operating condition set is within the scope of the model (that is, within the ranges for each variable used to build the model).

Using model 2, as we can conclude that material3 does not contribute to octane rating.

Material1 = 4.23 to 75.54
Material2 = 0 to 10.76
Condition = 1.19975 to 2.319090

Source Code:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store