• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Using R for Statistical Training: An Application to Six Sigma Methodology for Process Improvement.
 

Using R for Statistical Training: An Application to Six Sigma Methodology for Process Improvement.

on

  • 936 views

Presentation at the XXXIII Congreso Nacional de Estadística e Investigación Operativa (Madrid, April 2012)

Presentation at the XXXIII Congreso Nacional de Estadística e Investigación Operativa (Madrid, April 2012)

Statistics

Views

Total Views
936
Views on SlideShare
933
Embed Views
3

Actions

Likes
0
Downloads
49
Comments
0

1 Embed 3

http://www.linkedin.com 3

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Using R for Statistical Training: An Application to Six Sigma Methodology for Process Improvement. Using R for Statistical Training: An Application to Six Sigma Methodology for Process Improvement. Presentation Transcript

    • Using R for Statistical Training 17/04/2012 EL Cano, Using R for Statistical Training JM Moguerza, A Redchuk An Application to Six Sigma MethodologyStatistical Training for Process Improvement.The ProblemApproachesThe R ChoiceThe R frameworkSweave Emilio L. Cano, Andr´s Redchuk and Javier eApplication M. MoguerzaSix SigmaExamplesEnvironments Departamento de Estad´ıstica e Investigaci´n Operativa o Universidad Rey Juan Carlos (Madrid) XXXIII Congreso Nacional de Estad´ ıstica e Investigaci´n Operativa o SEIO 2012 1/28
    • Using R for Statistical Training Contenido 17/04/2012 EL Cano, JM Moguerza, A Redchuk 1 Statistical TrainingStatistical Training The ProblemThe ProblemApproaches ApproachesThe R ChoiceThe R frameworkSweaveApplicationSix SigmaExamplesEnvironments SEIO 2012 2/28
    • Using R for Statistical Training Contenido 17/04/2012 EL Cano, JM Moguerza, A Redchuk 1 Statistical TrainingStatistical Training The ProblemThe ProblemApproaches ApproachesThe R ChoiceThe R frameworkSweave 2 The R ChoiceApplicationSix Sigma The R frameworkExamplesEnvironments Sweave SEIO 2012 2/28
    • Using R for Statistical Training Contenido 17/04/2012 EL Cano, JM Moguerza, A Redchuk 1 Statistical TrainingStatistical Training The ProblemThe ProblemApproaches ApproachesThe R ChoiceThe R frameworkSweave 2 The R ChoiceApplicationSix Sigma The R frameworkExamplesEnvironments Sweave 3 Application Six Sigma Examples Environments SEIO 2012 2/28
    • Using R for Statistical Training Contenido 17/04/2012 EL Cano, JM Moguerza, A Redchuk 1 Statistical TrainingStatistical Training The ProblemThe ProblemApproaches ApproachesThe R ChoiceThe R frameworkSweave 2 The R ChoiceApplicationSix Sigma The R frameworkExamplesEnvironments Sweave 3 Application Six Sigma Examples Environments SEIO 2012 3/28
    • Using R for Statistical Training The Problem 17/04/2012 Elements of Statistical Training EL Cano, JM Moguerza, A RedchukStatistical TrainingThe ProblemApproachesThe R ChoiceThe R frameworkSweaveApplicationSix SigmaExamplesEnvironments SEIO 2012 4/28
    • Using R for Statistical Training Copy-paste Approach 17/04/2012 Approaches EL Cano, JM Moguerza, A RedchukStatistical TrainingThe ProblemApproachesThe R ChoiceThe R framework InconsistenciesSweaveApplication ErrorsSix SigmaExamplesEnvironments Out-of-date non-reproducible Painful changes SEIO 2012 5/28
    • Using R for Statistical Training Reproducible Research Approach 17/04/2012 Approaches EL Cano, JM Moguerza, A RedchukStatistical Training Reproducible ResearchThe ProblemApproaches The goal of reproducible research is to tieThe R ChoiceThe R framework specific instructions to data analysis andSweaveApplication experimental data so that scholarship can beSix SigmaExamples recreated, better understood and verifiedEnvironments Literate Programming Literate programming is a methodology that combines a programming language with a documentation language SEIO 2012 6/28
    • Using R for Statistical Training Reproducible Research 17/04/2012 Workflow EL Cano, JM Moguerza, A RedchukStatistical TrainingThe ProblemApproachesThe R ChoiceThe R frameworkSweaveApplicationSix SigmaExamplesEnvironments SEIO 2012 7/28
    • Using R for Statistical Training Contenido 17/04/2012 EL Cano, JM Moguerza, A Redchuk 1 Statistical TrainingStatistical Training The ProblemThe ProblemApproaches ApproachesThe R ChoiceThe R frameworkSweave 2 The R ChoiceApplicationSix Sigma The R frameworkExamplesEnvironments Sweave 3 Application Six Sigma Examples Environments SEIO 2012 8/28
    • Using R for Statistical Training The R System 17/04/2012 Choosing R EL Cano, JM Moguerza, A RedchukStatistical Training What is R?The ProblemApproaches R is a language and environment for statisticalThe R ChoiceThe R framework computing and graphics.SweaveApplicationSix SigmaExamples Open SourceEnvironments Platform independent Huge community Extensible 3 730 available http://www.r-project.org packages SEIO 2012 9/28
    • Using R for A LTEX, Beamer, PDF Statistical Training 17/04/2012 Choosing R EL Cano, JM Moguerza, A Redchuk A LTEXStatistical TrainingThe ProblemApproaches LaTeX is a high-quality typesetting system; itThe R ChoiceThe R framework includes features designed for the productionSweave of technical and scientific documentationApplicationSix SigmaExamplesEnvironments Beamer Beamer is a LaTeX class for creating presentations that are held using a projector, but it can also be used to create transparency slides LTEXFiles can easily be converted to PDF. A SEIO 2012 10/28
    • Using R for Statistical Training Sweave Documents 17/04/2012 An Efficient Framework EL Cano, JM Moguerza, A RedchukStatistical TrainingThe ProblemApproachesThe R Choice SweaveThe R frameworkSweave A Sweave document is a plain-text file whichApplication merges LTEX code and R code. The R ASix SigmaExamplesEnvironments function Sweave() converts the Sweave document (*.Rnw) into a LTEXfile (*.tex). A The code chunks are executed and the results embedded into the LTEX file. A SEIO 2012 11/28
    • Using R for Statistical Training Contenido 17/04/2012 EL Cano, JM Moguerza, A Redchuk 1 Statistical TrainingStatistical Training The ProblemThe ProblemApproaches ApproachesThe R ChoiceThe R frameworkSweave 2 The R ChoiceApplicationSix Sigma The R frameworkExamplesEnvironments Sweave 3 Application Six Sigma Examples Environments SEIO 2012 12/28
    • Using R for Statistical Training Methodology at a Glance 17/04/2012 Six Sigma EL Cano, JM Moguerza, A RedchukStatistical TrainingThe Problem The EssenseApproaches The application of the Scientific Method toThe R ChoiceThe R frameworkSweave process improvement, using an easy language.ApplicationSix SigmaExamples DMAIC CycleEnvironments Roles Define Champion Measure Master Black Belt Analyze Black Belt Improve Green Belt Control SEIO 2012 13/28
    • Using R for Statistical Training SixSigma Package 17/04/2012 Six Sigma EL Cano, JM Moguerza, Six Sigma with R | Paper Helicopter template Using packages max A Redchuk (9.5cm) std (8cm)Statistical TrainingThe Problem min (6.5cm) ManualsApproaches Data sets ← wings length →The R ChoiceThe R frameworkSweave Templates cutApplication Learn-by-Code ? peSix Sigma fold ↑ fold ↓ taExamplesEnvironments cut Six Sigma Process Map operators INPUTS cut cut tools X raw material facilities ← body length → INSPECTION ASSEMBLY TEST LABELING sheets sheets helicopter helicopter ... INPUTS INPUTS INPUTS INPUTS tape? tape? Param.(x): width NC Param.(x): operator C Param.(x): operator C Param.(x): operator C operator C cut P throw P label P Measure pattern P fix P discard P Featur.(y): label discard P rotor.width C environment N Featur.(y): ok rotor.length C Featur.(y): time paperclip C tape C min Featur.(y): weight (6.5cm) LEGEND std helicopter OUTPUTS fold ↓ ↓ fold ↑ ↑ (C)ontrollable (8cm) (Cr)itical (N)oise Y (P)rocedure clip? max Paper Helicopter Project max min ← body width → min max (9.5cm) SEIO 2012 (6cm) (4cm) (4cm) (6cm) 14/28
    • Using R for Statistical Training Book 17/04/2012 Six Sigma EL Cano, JM Moguerza, A Redchuk Six Sigma with RStatistical TrainingThe Problem A live example: The entire book has beenApproachesThe R Choice produced using Sweave.The R frameworkSweaveApplication The roadmap: TheSix SigmaExamplesEnvironments DMAIC Cycle The case study: paper helicopter SixSigma package: data sets, functions Easy explanations, further readings SEIO 2012 15/28
    • Using R for Statistical Training Sweave Example I 17/04/2012 Six Sigma Application EL Cano, JM Moguerza, A Redchuk documentclass [ a4paper ]{ article }Statistical Training usepackage { Sweave }The Problem title { Design of Experiments }Approaches author { EL Cano and JM Moguerza and A Rechuk }The R Choice begin { document }The R framework maketitleSweave section { Introduction }Application Design of experiments is the most important took in the ISix Sigma DMAIC cycle ldots .Examples < < > >=Environments library ( SixSigma ) doe . model1 <- lm ( score ~ flour + salt + bakPow + flour * salt + flour * bakPow + salt * bakPow + flour * salt * bakPow , data = ss . data . doe1 ) summary ( doe . model1 ) @ This is the general model : begin { equation } label { eq : doe : model } SEIO 2012 16/28
    • Using R for Statistical Training Sweave Example II 17/04/2012 Six Sigma Application EL Cano, JM Moguerza, A RedchukStatistical TrainingThe Problem y_ { ijkl }= mu + alpha_i + beta_j + gamma_k +( alpha beta ) _ { ij }Approaches ( alpha gamma ) _ { ik }+( beta gamma ) _ { kl }+( alpha beta gammaThe R Choice varepsilon_ { ijkl } ,The R framework end { equation }Sweave And here we have a plot of effects :ApplicationSix Sigma << maineff , echo = FALSE , fig = TRUE > >=Examples plot ( c ( -1 , 1) , ylim = range ( ss . data . doe1$score ) ,Environments coef ( doe . model1 )[1] + c ( -1 , 1) * coef ( doe type =" b " , pch =16) abline ( h = coef ( doe . model1 )[1]) @ % input { section2 } end { document } SEIO 2012 17/28
    • Estimate Std. Error t value Pr(>|t|)(Intercept) 5.5150 0.3434 16.061 2.27e-07 ***flour+ 1.8350 0.4856 3.779 0.005398 **salt+ -0.8350 0.4856 -1.719 0.123843bakPow+ -2.9900 0.4856 -6.157 0.000272 ***flour+:salt+ 0.1700 0.6868 0.248 0.810725flour+:bakPow+ 0.8000 0.6868 1.165 0.277620salt+:bakPow+ 1.1800 0.6868 1.718 0.124081flour+:salt+:bakPow+ 0.5350 0.9712 0.551 0.596779---Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1Residual standard error: 0.4856 on 8 degrees of freedomMultiple R-squared: 0.9565, Adjusted R-squared: 0.9185F-statistic: 25.15 on 7 and 8 DF, p-value: 7.666e-05This is the general model: yijkl = µ + αi + βj + γk + (αβ)ij + (αγ)ik + (βγ)kl + (αβγ)ijk + εijkl , (1) 1
    • 2
    • Using R for Statistical Training Project Example 17/04/2012 Divide and Conquer! EL Cano, JM Moguerza, A Redchuk StrategiesStatistical TrainingThe ProblemApproaches Partial Sweave files can be compiled to getThe R Choice partial LTEX files. R scripts can Sweave .Rnw AThe R frameworkSweave files and “source” .R files. The final documentApplicationSix Sigma is obtained by compiling the “master”ExamplesEnvironments LTEX file. A > source("code/myoptions.R") > source("code/myfunctions.R") > source("code/mydata.R") > Sweave("rnw/theorem01.Rnw") > Sweave("rnw/lesson01.Rnw") > Sweave("rnw/exercises01.Rnw") > ... > texi2pdf("master.tex") SEIO 2012 20/28
    • Using R for Statistical Training Some useful extensions 17/04/2012 Packages EL Cano, JM Moguerza, A Redchuk knitr, pgfSweave: enhanced options forStatistical TrainingThe Problem SweaveApproachesThe R Choice RGIFT: Automatic generation ofThe R frameworkSweave questionnaires for MoodleApplicationSix Sigma exams: Automatic generation of printableExamplesEnvironments exams odfWeave: Open Document format documents generation More in the “Reproducible Research” Task View at CRAN. http://cran.r-project.org/web/views/ ReproducibleResearch.html SEIO 2012 21/28
    • Using R for Statistical Training R GUI 17/04/2012 Integrated Environments EL Cano, JM Moguerza, A RedchukStatistical TrainingThe ProblemApproachesThe R ChoiceThe R frameworkSweaveApplicationSix SigmaExamplesEnvironments SEIO 2012 22/28
    • Using R for Statistical Training R Studio 17/04/2012 Integrated Environments EL Cano, JM Moguerza, A RedchukStatistical TrainingThe ProblemApproachesThe R ChoiceThe R frameworkSweaveApplicationSix SigmaExamplesEnvironments SEIO 2012 23/28
    • Using R for Statistical Training EMACS + ESS 17/04/2012 Integrated Environments EL Cano, JM Moguerza, A RedchukStatistical TrainingThe ProblemApproachesThe R ChoiceThe R frameworkSweaveApplicationSix SigmaExamplesEnvironments SEIO 2012 24/28
    • Using R for Statistical Training Eclipse + StatET 17/04/2012 Integrated Environments EL Cano, JM Moguerza, A RedchukStatistical TrainingThe ProblemApproachesThe R ChoiceThe R frameworkSweaveApplicationSix SigmaExamplesEnvironments SEIO 2012 25/28
    • Using R for Statistical Training Summary 17/04/2012 EL Cano, JM Moguerza, A Redchuk Statistical training entail some challenges regarding contents and materials.Statistical TrainingThe ProblemApproachesThe R ChoiceThe R frameworkSweaveApplicationSix SigmaExamplesEnvironments SEIO 2012 26/28
    • Using R for Statistical Training Summary 17/04/2012 EL Cano, JM Moguerza, A Redchuk Statistical training entail some challenges regarding contents and materials.Statistical TrainingThe ProblemApproaches R is the perfect partner for statisticalThe R ChoiceThe R framework training.SweaveApplicationSix SigmaExamplesEnvironments SEIO 2012 26/28
    • Using R for Statistical Training Summary 17/04/2012 EL Cano, JM Moguerza, A Redchuk Statistical training entail some challenges regarding contents and materials.Statistical TrainingThe ProblemApproaches R is the perfect partner for statisticalThe R ChoiceThe R framework training.SweaveApplication Reproducible research and literateSix SigmaExamples programming enhance training materialsEnvironments quality. SEIO 2012 26/28
    • Using R for Statistical Training Summary 17/04/2012 EL Cano, JM Moguerza, A Redchuk Statistical training entail some challenges regarding contents and materials.Statistical TrainingThe ProblemApproaches R is the perfect partner for statisticalThe R ChoiceThe R framework training.SweaveApplication Reproducible research and literateSix SigmaExamples programming enhance training materialsEnvironments quality. The use of R and LTEX through Sweave, A comprise a complete framework for statistical documentation generation. SEIO 2012 26/28
    • Using R for Statistical Training Summary 17/04/2012 EL Cano, JM Moguerza, A Redchuk Statistical training entail some challenges regarding contents and materials.Statistical TrainingThe ProblemApproaches R is the perfect partner for statisticalThe R ChoiceThe R framework training.SweaveApplication Reproducible research and literateSix SigmaExamples programming enhance training materialsEnvironments quality. The use of R and LTEX through Sweave, A comprise a complete framework for statistical documentation generation. Extensions and integrated environments make easy exploiting the R capabilities. SEIO 2012 26/28
    • Using R for Statistical Training Acknowledgements 17/04/2012 EL Cano, JM Moguerza, A RedchukStatistical TrainingThe ProblemApproaches R Core Team and R enthusiasts in general.The R Choice SpringerThe R frameworkSweaveApplication This work has been partially funded by the projects:Six Sigma AGORANET project (IPT-430000-2010-32)Examples VRTUOSI www.vrtuosi.org: 502869-LLP-1-2009-ES-ERASMUS-EVC)Environments HAUS: IPT-2011-1049-430000 EDUCALAB: IPT-2011-1071-430000 DEMOCRACY4ALL: IPT-2011-0869-430000 CORPORATE COMMUNITY: IPT-2011-0871-430000 SEIO 2012 27/28
    • Using R for Statistical Training Discussion 17/04/2012 EL Cano, JM Moguerza, A RedchukStatistical TrainingThe ProblemApproachesThe R ChoiceThe R frameworkSweave Thanks for yourApplicationSix SigmaExamplesEnvironments attention ! SEIO 2012 28/28