industRial practice

library(learnr)
library(tidyverse)
library(knitr)
source("theme_industRial.R")
# dial_control <- industRial::dial_control
# write_rds(dial_control, "dial_control.rds")
dial_control <- read_rds("dial_control.rds")
knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)

Design for Six Sigma - Pareto charts

Review: pareto principle

The pareto principle in itself just stats that most outputs come from a reduced proportion of inputs and the Pareto charts are a rather simple type of bar charts but they're extremely powerful by helping focusing on the main priorities. We can effectively see over and over that the pareto principle applies and in most industrial setups there are a few quality issues impacting the cost or the productivity of an equipment.

Pareto charts can be built from scratch by wrangling the data, making counts occurrences and calculating the proportions in percentage. This can be done with packages like {dplyr} and {ggplot2}. Fortunately due the large community working with open source tools there are other shorter paths to get there...

Question: pareto use cases

quiz(
  question("What is an usual formulation of the pareto principle in the industry?",
    answer("80/20 principle meaning that 80% of the problems come from 20% of the causes.", correct = TRUE),
    answer("60/40 principle meaning that 60% of the problems come from 40% of the causes."),
    answer("50/50 principle meaning that any problem as the same chances of occuring."),
    answer("If a problem can occur it will occur."),
    allow_retry = TRUE
  )
)

Exercise: check the data

We've also loaded the dial control data set is in memory. It can easily be called by its name dial_control. Use the code chunk below to inspect the dataset. How many variables have been collected by the dial production team in the data set? Which are they?


head(dial_control)

Play: pareto app

Four variables are available in the dataset: the operator, the date, the defect type and the defect location in the dial. Have a look at the plots that can be obtained by simply changing the variable. The location corresponds to the hour, e.g. 3h is on the right of the dial and 6h is on the bottom.

library(qicharts2)
fluidPage(
  titlePanel("Dial control pareto charts"),
  sidebarLayout(
    sidebarPanel(
      selectInput(
        inputId = "variable",
        label = "Select variable",
        choices = c("Operator", "Date", "Defect", "Location"),
        selected = "Defect",
        multiple = FALSE
      )
    ),
    mainPanel(
      plotOutput("pareto")
    )
  )
)
library(tidyverse)
library(qicharts2)
output$pareto <- renderPlot({
  d_type <-
    dial_control %>% pull(.data[[input$variable]]) %>% as.character()
  paretochart(
    d_type,
    title = "Watch Dial polishing",
    subtitle = "Pareto chart",
    ylab = "Percentage of deffects",
    xlab = "Selected variable",
    caption = "Source: Dial Production Team"
  ) + theme_industRial()
  })

Note that date is usually not considered for a parato plot as time passes and 80/20 rule would not apply. For that a timeseries plot would be the suited approach allowing to see the evolution of the problems in time. Although from a dataset point of view Operator is also a variable it needs to be handled with care to avoid unfair judgment of team members performance.

Exercise: bar plot

We're loading the qicharts2 package for our next plot:

library(qicharts2)

We now propose you the manual creation of the pareto chart. Add the necessary code below in order to obtain the pareto by operator.

d_type <- dial_control %>% pull(Operator) %>% as.character()
paretochart(

)

Quiz: choose packages

Lets start this module with a simple quiz to review where to get functions for easily establish pareto charts:

quiz(
  question("Which packages below include a specific function to plot pareto charts?",
    answer("qcc", correct = TRUE),
    answer("SixSigma"),
    answer("ggplot2"),
    answer("qicharts2", correct = TRUE)
  )
)


Try the industRial package in your browser

Any scripts or data that you put into this service are public.

industRial documentation built on June 11, 2021, 5:10 p.m.