Back
Featured image of post Did I improve my process ? The statistical way with Python

Did I improve my process ? The statistical way with Python

Using statistics with python for ANOVA analysis.

Let’s say that we have just modified our filling process for our 1500ml soda bottles. We do an extract from our measurement system on the last 200 bottles produced before the modification, and 50 after.

Firsts results

Below the first results with different representations.

scatter plot
scatter plot
line plot
line plot
box plot
box plot

Hypothesis

Here are our hypothesis :

  • In average, we’ve reduced the quantity per bottle (mean before = 1500.05ml, mean after 1499.93ml).
  • We’ve reduced the dispersion (standard deviation before = 1,09, standard deviation after = 0,87).

Is it true of false ? Let’s answer by statistical checks.

Verification

Normality checks

Let’s check the normality of our data.

Histogram normality check
Histogram normality check
QQplot normality check
QQplot normality check

Results :

  • Visually OK.
  • The Shapiro Wilk is a way above 0.05.

The data follow a normal law.

Variance (dispersion) equivalence tests

We want to know if there is a difference in terms of dispersion between before and after. For that, we’ll use a few statistical tests.

  • F-test
  • Levene test
  • Bartlett test

Anova box plot variance equivalence tests
Anova box plot variance equivalence tests

All the tests are above 0.05, we can say that there is no significant difference in terms of dispersion between before and after.

Note : The Bartlett test is sensitive to departures from normality, that might explain the low score.

Mean equivalence test

We want to know if there is a difference in terms of mean between before and after. For that, we’ll use a F-test assuming that the variances are equivalent (see before).

Anova box plot mean equivalence tests
Anova box plot mean equivalence tests

As the result is a way above 0.05, we can say that there is no significant difference in terms of mean between before and after.

Conclusion

Anova result
Anova result

Sorry, you did not improve your process !

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy