How to perform RSM using MATLAB – Part 2

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 (R2) 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 R2 (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. R2 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 R2 is termed as the adjusted R2. If the value of the adjusted R2 is more than the R2 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 R2 is less than the R2.

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 =











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



Etiquette at schools

One of the most important aspects of child education is about ownership of the responsibility. Once the kid is admitted to a school, the parents feel that imparting the personality traits such as honesty, discipline, integrity, truthfulness etc. is the responsibility of the teachers and the school management. They often keep quoting, so and so school kids are too disciplined, too smart, too bright etc. But they effortlessly forget their part. And, with both the parents fully immersed in the pool for earning money, they even do not bother to sit with the kids for homework. No wonder, many such parents prefer schools which do not burden the kids with the exercises called homework, projects, models etc. Then, how do we expect miracles from kids? It is to be noted that, there are homes where parents or the guardians undo all the efforts put up by the teachers at schools by letting loose their kids. There are parents who neither check their kid’s progress nor allow other members or caretakers to check the progress. It is easy to imagine what those kids will turn into. Continue reading

Research in India: A point to research


There is a lot outcry on new US president’s actions after assuming the office. I really wondered why it is being considered wrong to take strict actions by a country’s Premier towards safeguarding the interest of his own countrymen. He may not be hundred percent right, but you can’t call him wrong either.  Continue reading

useful research

That’s what I am trying to do

discover the undiscovered

research the unsearched

explore the unexplored

but is it worth to waste

your plenty of precious time

your years of hard work

in microbes and enzyme

after all they are not visible

and so is your effort on them

they are not helping you either

can you be still wiser

discover something big

discover something important

discover something to show

that efforts are not dormant


Daily Prompt: Enthusiasm

I do wait

with lots of enthusiasm

when the experiments are done

and the outcome is awaited

when the exams are over

and the results are awaited

when the reaction is ON

and the effect is awaited

when the simulation is running

and the conclusion is awaited

but it is never the same way

the results never as expected

the outcome as planned

the effect as proposed

the conclusion as programmed

so the enthusiasm is conditional

the way the joy is…


our fortune

it is our fortune

we are born as humans

but we never care for

creatures smaller than us

as we think

the size represent the power

we hit weak people

we kill innocent creatures

we feel we are powerful

but the very fact is that

we are ignorant and petite

we are mortal and fragile

we can’t even fight a virus

we cannot defeat a bacteria

so, why are we so supercilious?

in this colossal milky way

we are no bigger than microbes

our identity is so miniscule

our life is as susceptible as theirs

we should thank the almighty

for the life he has bestowed

and live it with modesty and peace