Contd… from Part 1
You may type exactly the same written below in the MATLAB command prompt
stat_out = regstats(e_out,react,’quadratic’);
Please remember that in MATLAB the parameter at the left of the equal sign is the output (stat_out) that will be generated and stored with that name for the inputs imparted in the brackets (e_out and react in this case).
The command regstats is the regression diagnostics which will take react and e_out as the inputs and create a regression model with the type of dependability mentioned in the quote (in this case we have entered quadratic). The output somewhat looks like this:
stat_out =
source: ‘regstats’
Q: [24×10 double]
R: [10×10 double]
beta: [10×1 double]
covb: [10×10 double]
yhat: [24×1 double]
r: [24×1 double]
mse: 0.0588
rsquare: 0.9066
adjrsquare: 0.8466
leverage: [24×1 double]
hatmat: [24×24 double]
s2_i: [24×1 double]
beta_i: [10×24 double]
standres: [24×1 double]
studres: [24×1 double]
dfbetas: [10×24 double]
dffit: [24×1 double]
dffits: [24×1 double]
covratio: [24×1 double]
cookd: [24×1 double]
tstat: [1×1 struct]
fstat: [1×1 struct]
dwstat: [1×1 struct]
One will be surprised to see this much of statistically important information provided by a simple command. We need to decipher it to completely understand the importance of each item.
Typing help regstats at the MATLAB command window shall provide information for all these output items.
Currently one can focus on few of them as mentioned below:
Mse with a value of 0.0588 tells us about the mean squared error, rsquare (R^{2}) with a value of 0.9066 tells us about the R-square statistic and adjrsquare with a value of 0.8466 tells about the adjusted -square statistic of our model. Mean squared error can be termed as the variance of the residuals, the lower values of which indicate better fit The R-square value is one minus the ratio of the error sum of squares to the total sum of squares. This value can be negative for models without a constant term.
Also the R^{2 }(determination coefficient) value, is the measure of the goodness of fit of the model. In this case it is 0.9066, which means that 90.66% of the total variation in the observed response value could be explained by the model, or by experimental parameters and their interactions. The rest 9.34% (1-0.9066) can be attributed to the experimentation and other errors. R^{2 }value of 0% indicates that the model is not able to explain the variability of the response data. This can be verified by plotting the residuals (shall be explained further).
When the terms of the model can be adjusted to get a better goodness of fit the corresponding R^{2} is termed as the adjusted R^{2}. If the value of the adjusted R^{2} is more than the R^{2} then the model has the probability of getting a better goodness of fit by the adjustment of the terms involved in the formulation of the model. Generally the value of adjusted R^{2} is less than the R^{2}.
The beta term in stat_out represents the regression coefficients. These can be used to write the model in the form of an equation. So, if we type stat_out.beta at the MATLAB command window, we will get:
stat_out.beta =
28.5815
-0.3935
-15.0104
-3.7943
0.1425
0.0453
1.6625
-0.0001
-1.3209
0.0268
There shall be 10 values displayed. These values need to be interpreted for the standard quadratic equation with constant, linear, interaction, and squared terms as follows:
First value | 28.5815 | constant | |
Second value | -0.3935 | react (1) | Linear terms |
Third value | -15.0104 | react (2) | |
Fourth value | -3.7943 | react (3) | |
Fifth value | 0.1425 | react (1) x react (2) | Interaction terms |
Sixth value | 0.0453 | react (1) x react (3) | |
Seventh value | 1.6625 | react (2) x react (3) | |
Eighth value | -0.0001 | react (1)^{2} | squared terms |
Ninth value | -1.3209 | react (2)^{2} | |
Tenth value | 0.0268 | react (3)^{2} |
So the model can be written in equation form as follows:
Output = First value (Constant) + second value x react (1) + third value x react (2) + fourth value x react (3) + fifth value x react (1) x react (2) + Sixth value x react (1) x react (3) + Seventh value x react (2) x react (3) + Eighth value x react (1)^{2} + Ninth value x react (2)^{2} + Tenth value x react (3)^{2}
Or in this case,
Biomass (mg/ml) = 28.5815 + (-0.3935) x Temperature + (-15.0104) x Peptone concentration + (-3.7943) x pH + 0.1425 x Temperature x Peptone concentration + 0.0453 x Temperature x pH + 1.6625 x Peptone concentration x pH + -0.0001 x Temperature x Temperature + -1.3209 x Peptone concentration x Peptone concentration + 0.0268 x pH x pH
End of Part 2