MTB 02 Intermediate Minitab This module will cover: Advanced graphing Changing data types Value Order Making similar graphs Zooming worksheet Brushing Multi-graphs: By variables Interactively upgrading graphs / time axes Interactive Graph Layouts Including: Subsetting while graphing Secondary Axes Line / Bar combo graph Cont d M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 1
MTB 02 Intermediate Minitab Cont d Data Manipulation Calculations using IF statements Splitting vs Subsetting worksheets Creating tables of summary statistics Lookup tables Forward lags Working Environment Graphs into PowerPoint Which worksheet generated my graph? Options > Graph > Annotation M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 2
MTB 02 Advanced Graphing We will work with this sample dataset which has a strength value for a product made in a 12 hour shift process: Open in Minitab: Strength.CSV D = Days; N = Nights M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 3
MTB 02 Change Data Type We notice that the first column is text when we need it to be date/time so it can used for graphing, etc. We fix this with Data > Change Data Type > Text to Date/Time We change the data in place. A safer option would be to create a new column but we haven t invested much in this worksheet so far. The data is in International date format by far the best! M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 4
MTB 02 Scatterplot vs Time Let s start with a simple graph of Strength vs Time M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 5
Strength MTB 02 Scatterplot vs Time This is good start 100 90 Scatterplot of Strength vs Shift Start The gap in production would not have been obvious is a simple Time Series graph 80 70 We notice a production gap. This was an overhaul. 60 50 40 30 20 2010-01-01 2011-01-01 Shift Start 2012-01-01 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 6
Strength MTB 02 Scatterplot vs Time We make edits to the graph: Add a Lowess Smoother with a Degree of Smoothing of 0.1, a line colour of black and a width of 7 We get rid of the X axis label We add minor ticks to the X-axis We add gridlines We add a grouping variable of crew to the symbols Change connect line colour Edit Legend Add and edit a reference line at the lower spec. limit. 100 90 80 70 60 50 40 30 20 2010-01-01 Scatterplot of Strength vs Shift Start 2011-01-01 2012-01-01 Yogi Berra: You can observe a lot just by watchin. Is there a seasonal effect? Are C crew strength values low? Did the process start with low strength after the overhaul? Crew A B C D LSL M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 7
Strength MTB 02 Boxplots Let s systematically look at this dataset. We start with Graph > Boxplot > With Groups and plot Strength by Crew: 100 Boxplot of Strength 90 80 70 60 50 40 30 C crew strength values look low, but is it statistically significant? 20 A B Crew C D M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 8
Strength MTB 02 Make Similar Graph While our boxplot has focus, we click on Editor > Make Similar Graph and create new graphs of Strength vs Shift and Speed It would make sense to list the speeds as Slow, Medium, Fast but 100Minitab will default to alphabetical. 90 We fix on next slide. 80 Boxplot of Strength 70 60 50 40 30 20 Fast Medium Speed Slow M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 9
MTB 02 Value Order We choose the User Specified Order, and edit in the window provided As soon as we make the change, the graph shows the Yellow status meaning the data has changed. We right click on it and choose Update Graph Our updated graph! M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 10
MTB 02 Layout Tool We click on one of the graphs to give it focus, and then click on Editor > Layout Tool We change to 1 Row, 3 Columns We select our BoxPlots to be included by clicking & using the arrow or by double clicking. You can move graphs from one panel to another by clicking and dragging. When you are done you click Finish. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 11
Strength Strength Strength MTB 02 Layout Tool Our completed graph layout. Boxplot of Strength Boxplot of Strength Boxplot of Strength 100 100 100 All three factors look like they might be statistically significant. 90 80 70 60 90 80 70 60 90 80 70 60 Let s do a formal test. 50 40 50 40 50 40 30 30 30 20 20 20 Slow Medium Speed Fast A B Crew C D D Shift N M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 12
MTB 02 ANOVA One-way ANOVA: Strength versus Crew Source DF SS MS F P Crew 3 15537.8 5179.3 61.72 0.000 Error 1748 146682.1 83.9 Total 1751 162219.9 S = 9.160 R-Sq = 9.58% R-Sq(adj) = 9.42% The factor is significant (P value of 0.000) and explains about 9% of the variability in strength. Individual 95% CIs For Mean Based on Pooled StDev Level N Mean StDev ---------+---------+---------+---------+ A 469 61.833 9.125 (--*--) B 407 63.545 9.507 (--*--) C 407 55.318 8.838 (--*--) D 469 59.937 9.164 (--*--) ---------+---------+---------+---------+ 57.0 60.0 63.0 66.0 Pooled StDev = 9.160 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 13
MTB 02 Run Chart A similar analysis for Speed and Shift shows they are also statistically significant, explaining about 22% and 6% respectively of the variation in strength. What about our possible seasonal trend? One tool we could use is: We use 2 since there are 2 shifts in a day. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 14
Strength MTB 02 Run Chart The data shows all sorts of non random behaviour. 100 90 80 Run Chart of Strength (OK this is a manufactured data set!) : 60 50 40 30 70 20 1 100 200 300 400 500 Sample 600 700 800 Number of runs about median: 348 Expected number of runs: 439.0 Longest run about median: 18 Approx P-Value for Clustering: 0.000 Approx P-Value for Mixtures: 1.000 Number of runs up or down: 549 Expected number of runs: 583.7 Longest run up or down: 5 Approx P-Value for Trends: 0.003 Approx P-Value for Oscillation: 0.997 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 15
MTB 02 Extracting Day of Wk Some manufacturing processes exhibit differences based on day of the week. Could this be happening here? We then use an alternative tool, Stat > ANOVA > Interval Plot ANOVA shows that this factor explains about 10% of the variability in strength. If only typical data had such obvious sources of variation! M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 16
MTB 02 Assigning Formulae Here is how we can assign a formula to a column: We right click on the new column We type in the column name manually You can also assign formulae through the Calc > Calculator checkbox. The symbol shows that this column has a formula assigned. Any change to the input columns will update this column. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 17
MTB 02 Confounding ANOVA shows that weekend is statistically significant. However, this might be because Thursday is unusual. We calculate an new value of strength which is missing for Thursdays: A repeat ANOVA analysis using StrengthNotThurs shows no statistical significance. It looks like the Weekend variable was confounded with the DayOfWk variable. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 18
MTB 02 Brushing Brushing: We click on the Brush Icon (or click on the graph and then Editor > Brush) The highlighted points have their row shown in the Brushing window. We click single points or click and drag to highlight multiple points of interest. If we hold down <Shift> we can highlight more than one range or one point. In the worksheet, highlighted rows are shown via a dot beside the row number. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 19
MTB 02 Brushing We can also change what appears in the Brushing window. With the points still highlighted, we click on Editor > Set ID Variables. Here we have selected all of the variables to appear in the Brushing window. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 20
MTB 02 Brushing If we choose Data > Subset we can copy these brushed rows into a new worksheet. If we also click on Exclude we can copy only the non brushed rows into a new spreadsheet. Given the highlighted points, this means we could end up with a worksheet of out of spec. or in spec. rows respectively. Note: Another way to subset from the current worksheet is to use the Rows that match Condition option to use a calculator style criteria to subset rows of interest e.g. Speed = Slow M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 21
MTB 02 Splitting You can also split a worksheet on the basis of unique values of a categorical variable. Be careful not to use a continuous variable or you may get hundreds of worksheets! You can see the new sheets in the Project Manager window M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 22
MTB 02 Zooming Holding down the <Ctrl> key and using the scroll wheel let you zoom the font size of the worksheet. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 23
MTB 02 Descriptions You can add column descriptions via right clicking on the column: After you ve entered a column description, you see the red triangle. If you hover over it, you will see the description. You can add worksheet descriptions as well! M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 24
Strength MTB 02 Multi-graphs We start with Graph > Scatterplot Use of a By variable to split a graph into Panels Scatterplot of Strength vs Shift Start A 2010-01-01 2011-01-01 B 2012-01-01 100 80 60 40 100 C D 20 80 60 40 20 2010-01-01 2011-01-01 2012-01-01 Shift Start Panel variable: Crew M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 25
2010-01-01 2011-01-01 2012-01-01 2010-01-01 2011-01-01 2012-01-01 Strength MTB 02 Multi-graphs Same graph after further edits: We get rid of the X axis label We add minor ticks to the X-axis We add gridlines We change panels to not alternate, to have a margin of 0.009, Don t Alternate Panels, Both Variable Names and Levels changing font colour & to bold Change symbol type & colour Add and edit a reference line at the lower spec. limit. 100 80 60 40 20 100 80 60 40 20 Scatterplot of Strength vs Shift Start Crew = A Crew = B Crew = C Crew = D LSL LSL M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 26
Strength Strength Strength Strength MTB 02 Multi-graphs We start with Graph > Scatterplot Use of a By variable to split a graph into Pages 100 90 80 70 60 50 40 30 20 2010-01-01 Scatterplot of Strength vs Shift Start Crew = A 100 90 80 70 60 50 40 30 20 2010-01-01 Scatterplot of Strength vs Shift Start Crew = B 100 90 80 70 60 2011-01-01 Shift Start 50 40 30 20 2010-01-01 2012-01-01 Scatterplot of Strength vs Shift Start Crew = C 100 90 80 70 60 2011-01-01 Shift Start 50 40 30 20 2012-01-01 2011-01-01 Shift Start Scatterplot of Strength vs Shift Start Crew = D 2012-01-01 2010-01-01 2011-01-01 Shift Start 2012-01-01 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 27
MTB 02 Interactive Upgrading of Graphs We will work with this sample dataset which has the output and max. output capability of the wind power generation farms in Ontario: Open in Minitab: WindByStation.CSV An obvious graph would be to look at the output of the various stations vs date: M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 28
Output MTB 02 Interactive Upgrading of Graphs The resulting graph is a little too busy to be very useful. Scatterplot of Output vs Date 200 150 100 50 Generator AMARANTH COMBER DILLON GOSFIELDWGS GREENWICH GREENWICH-T1 GREENWICH-T2 KINGSBRIDGE PAROCHES PORT BURWELL PORTALMA-T1 PORTALMA-T3 PRINCEFARM RIPLEY SOUTH SPENCE UNDERWOOD WOLFE ISLAND 0 2011-09-01 2011-10-01 Date 2011-11-01 2011-12-01 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 29
MTB 02 Interactive Upgrading of Graphs We can put each generating station in a separate panel of the graph: M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 30
MTB 02 Interactive Upgrading of Graphs And we can subset the data to be the latest data M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 31
Output MTB 02 Interactive Upgrading of Graphs This graph is much more readable Scatterplot of Output vs Date 2011-11-16 2011-11-21 2011-11-26 2011-11-16 2011-11-21 2011-11-26 200 100 0 200 100 0 2011-11-16 AMARANTH 2011-11-21 2011-11-26 COMBER DILLON GOSFIELDWGS GREENWICH GREENWICH-T1 GREENWICH-T2 KINGSBRIDGE PAROCHES PORT BURWELL PORTALMA-T1 PORTALMA-T3 PRINCEFARM RIPLEY SOUTH SPENCE UNDERWOOD Panel variable: Generator WOLFE ISLAND 2011-11-16 2011-11-21 Date 2011-11-26 2011-11-16 2011-11-21 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 32 2011-11-26 200 100 0 200 100 0 Generator AMARANTH COMBER DILLON GOSFIELDWGS GREENWICH GREENWICH-T1 GREENWICH-T2 KINGSBRIDGE PAROCHES PORT BURWELL PORTALMA-T1 PORTALMA-T3 PRINCEFARM RIPLEY SOUTH SPENCE UNDERWOOD WOLFE ISLAND
2011-11-16 2011-11-19 2011-11-22 2011-11-25 2011-11-16 2011-11-19 2011-11-22 2011-11-25 2011-11-16 2011-11-19 2011-11-22 2011-11-25 2011-11-16 2011-11-19 2011-11-22 2011-11-25 2011-11-16 2011-11-19 2011-11-22 2011-11-25 Output After some edits: Output by Wind Farm MTB 02 Interactive Upgrading of Graphs 200 100 0 200 100 0 200 100 0 200 100 0 AMARANTH COMBER DILLON GOSFIELDWGS GREENWICH GREENWICH-T1 GREENWICH-T2 KINGSBRIDGE PAROCHES PORT BURWELL PORTALMA-T1 PORTALMA-T3 PRINCEFARM RIPLEY SOUTH SPENCE UNDERWOOD WOLFE ISLAND We edit the graph: X axis label removed X axis ticks to 90 degrees, Font size 7, 5 ticks Title Legend deleted Panel footnote deleted Size of Symbols (1 to 0.75) Add gridlines Panel Options: Don t alternate Margin 0.009 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 33
MTB 02 Interactive Upgrading of Graphs Why the picket fence appearance? This is because all 24 values for each day are plotted at the start of that day We need a date/time variable that includes the hours & minutes portion The dataset includes the time portion of the date/time M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 34
MTB 02 Interactive Upgrading of Graphs << We create a date + time variable Minitab uses the same date/time convention as Excel. Dates start at 1900 and go up by 1 for each day. Time values go from 0 to 1 representing fractions of a day. We select (or type in) yyyy-mm-dd hh:mm The we format the column by right clicking on the grey column header: M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 35
MTB 02 Interactive Upgrading of Graphs Now instead of starting over to create a graph of output vs DateTime, we use the make similar graph dialogue: M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 36
2011-11-16 2011-11-19 2011-11-22 2011-11-25 2011-11-16 2011-11-19 2011-11-22 2011-11-25 2011-11-16 2011-11-19 2011-11-22 2011-11-25 2011-11-16 2011-11-19 2011-11-22 2011-11-25 2011-11-16 2011-11-19 2011-11-22 2011-11-25 Output MTB 02 Interactive Upgrading of Graphs 200 AMARANTH Output by Wind Farm COMBER DILLON GOSFIELDWGS GREENWICH 100 0 200 GREENWICH-T1 GREENWICH-T2 KINGSBRIDGE PAROCHES PORT BURWELL 100 0 200 PORTALMA-T1 PORTALMA-T3 PRINCEFARM RIPLEY SOUTH SPENCE 100 0 200 UNDERWOOD WOLFE ISLAND 100 0 Can you see what additional edits have been made to the graph?? M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 37
MTB 02 Interactive Upgrading of Graphs What if we wanted to show the output of the major farms (only) overlaid on a graph. How would we define a major farm? By average power output We would like to add a column with average output by station. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 38
MTB 02 Interactive Upgrading of Graphs Here is the dialogue: This option puts the average value on each line instead of creating a table of average values This creates a new column Mean1 which has, for every row, the average output for the station appearing in that row. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 39
MTB 02 Interactive Upgrading of Graphs Now we can create a graph showing just recent data for the major farms: M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 40
2011-11-21 00:00 2011-11-22 00:00 2011-11-23 00:00 2011-11-24 00:00 2011-11-25 00:00 2011-11-26 00:00 Output MTB 02 Interactive Upgrading of Graphs After some additional edits 200 150 Power Output for Major Wind Farms 100 50 0 Generator AMARANTH PRINCEFARM UNDERWOOD WOLFE ISLAND M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 41
2011-11-23 2011-11-24 2011-11-25 2011-11-26 2011-11-23 2011-11-24 2011-11-25 2011-11-26 MTB 02 Multi-Graphs Part 2 Scatterplot of Capability, Output vs DateTime 200 150 100 50 Capability*DateTime 200 150 100 50 Output*DateTime Generator AMARANTH COMBER DILLON GOSFIELDWGS GREENWICH GREENWICH-T1 GREENWICH-T2 KINGSBRIDGE PAROCHES PORT BURWELL PORTALMA-T1 PORTALMA-T3 PRINCEFARM RIPLEY SOUTH SPENCE UNDERWOOD WOLFE ISLAND 0 0 After some additional edits This may not be a very useful view here, but sometimes this capability is just what the Doctor ordered! M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 42
MTB 02 Graph Layouts Open in Minitab: NaturalGas.CSV Data to be plotted Day into year. MMDD is that date +1 converted into MM-DD format This is the cumulative consumption so far in this year. This is the cumulative cost so far in this year. (Costs not avail. for first years) M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 43
MTB 02 Graph Layouts We generate a scatter plot with connect and groups: M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 44
SumConsumption MTB 02 Graph Layouts The graph is pretty close to what we want right out of the box: 2500 2000 1500 1000 Scatterplot of SumConsumption vs MMDD Year 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 500 0 01-01 03-01 05-01 07-01 MMDD 09-01 11-01 01-01 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 45
Sum Consumption (m**3) MTB 02 Graph Layouts We edit the graph: Y axis label X axis label Title Size of Symbols (1 to 0.75) Connect lines (to solid) Add gridlines 2500 2000 1500 1000 Cumulative Consumption by Year Year 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 500 0 01-01 03-01 05-01 07-01 MM-DD 09-01 11-01 01-01 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 46
SumCost MTB 02 Graph Layouts Following a similar approach, we create a graph for Cumulative Cost by Year. Scatterplot of SumCost vs MMDD You notice that there are no costs until March of 2008. We need to change the graph so that we only plot data from 2009 and on. 1200 1000 800 600 400 200 Year 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 0 01-01 03-01 05-01 07-01 MMDD 09-01 11-01 01-01 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 47
MTB 02 Graph Layouts Here is how we do that: M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 48
SumCost MTB 02 Graph Layouts After some simple modification, here is what our graph looks like: Much Better! 1200 1000 Cummulative Cost by Year Year 2009 2010 2011 2012 800 600 400 200 0 01-01 03-01 05-01 07-01 09-01 11-01 01-01 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 49
MTB 02 Graph Layouts While one of the graphs has focus, we then use Editor > Layout Tool M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 50
MTB 02 Graph Layouts We change to 1 Row, move the cost to the right panel and bring the consumption into the left panel M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 51
Sum Consumption (m**3) Cumulative Cost MTB 02 Graph Layouts Cumulative Consumption by Year Cumulative Cost by Year After clicking Finish, we get this. 2500 2000 1500 Year 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 1200 1000 800 Year 2009 2010 2011 2012 A thing of beauty! 1000 600 400 500 200 0 01-01 04-01 07-01 MM-DD 10-01 01-01 0 01-01 04-01 07-01 MM-DD 10-01 01-01 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 52
MTB-02 Secondary Axes Open in Minitab: NaturalGas.CSV First we plot consumption vs date and degree days vs date, overlaid on the same graph: M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 53
MTB-02 Secondary Axes The resulting graph is a good starting point: We double click on the Y axis, select the Secondary tab and change the second line to plot on a secondary Y axis M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 54
MTB-02 Secondary Axes We take this graph and make customizations: Get rid of the label Date on the X axis Change the font colour of the Y1 axis to a blue Change the colour of the Y1 axis ticks to blue Do the same for the Y2 axis to make it red Get rid of the legend Add gridlines Edit the title M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 55
MTB-02 Line / Bar Combo We could stop here or continue to make this a bar / line plot. We right click on the graph > Add > Data Display > Project Lines M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 56
MetersCubed DegreeDaysC MTB-02 Line / Bar Combo 500 400 300 Natural Gas Consumption, Degree Days We click twice on one of the red project lines (where 1000 it does not overlap the black project line) and then 800 choose type of none to get rid of this project line. 600 200 400 100 200 0 1/01/02 1/01/04 1/01/06 1/01/08 1/01/10 1/01/12 0 M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 57
1/01/07 1/01/08 1/01/09 1/01/10 1/01/11 1/01/12 MetersCubed DegreeDaysC MTB-02 Line / Bar Combo Natural Gas Consumption, Degree Days 500 Missing data! 400 300 200 100 1000 800 600 400 200 We make further edits: Get rid of Y1 symbols, line Change range of time axis Change colour and width of Y1 project lines Change size of Y2 symbols 0 0 Note: consumption correlates very well with degree days except during the summer (when the main consumption is water heating). M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 58
MTB-02 Forward Lags Consider this data from a batch process: Open in Minitab: BatchData.CSV Standard practice says that a Clean Out is needed on the last batch prior to a product change. You want to highlight these batches and flag batches that missed the clean out. (Note: there is a column which records if a clean out was performed. We need to look at the next row to see if there is a product change. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 59
MTB-02 Forward Lags One approach to this would be to use a DO loop and look at the next row however this approach is complex and slow. (Looping code in Minitab macros is slow to execute). The simplest approach is to sort the data into reverse order and then use the standard lag function. In this case the batches have a time stamp that can be used for the sort. (If not you could create a row number variable first). Once the data is sorted in reverse you can use a calculator function to see if a product change has happened and if the clean out was done and create appropriate Status text. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 60
MTB-02 Forward Lags Here is the code which goes into the calculator with added comments: (my text editor adds the handy colouring) Here is the worksheet after the sort & calculation: The latest batch shows a missed clean out but until there is data for the next batch that may or may not be true. Next batch in time for the batch on row 5 is the batch on row 4. Thus the row 4 batch missed a clean out. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 61
2012-01-07 12:00 2012-01-07 18:00 2012-01-08 00:00 2012-01-08 06:00 2012-01-08 12:00 2012-01-08 18:00 2012-01-09 00:00 PropertyX O O Missed C/O O O Missed C/O MTB-02 Forward Lags Here is a graph that can be generated with the data now available: 42 41 40 39 38 37 Property X results for Batches Next batch in time for the batch on row 5 is the batch on row 4. Thus the row 4 batch missed a clean out. Product A B C The latest batch shows a missed clean out but until there is data for the next batch that may or may not be true. 36 35 Circled Batches precede product changes The Scatterplot with groups > Labels sub-dialogue is used to select our Status text column to be used for data labels. Once the graph has been generated, the data labels are edited to increase the Font Size, and so the Text Angle = 90 and then the horizontal & vertical offset is adjusted so the plot symbols are circled M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 62
MTB-02 Forward Lags Another approach is possible, but you likely would only use it for large, complex datasets. In this approach for our example: You create a row number and a row number plus 1 variables You create a table of product types vs row number You then use the Data > Code > Use Conversion Table (Minitab s version of the lookup function), and add the product corresponding to row number plus 1 to the current row in a new column Now you can this new column for the value in the next row. The advantage is that you do not need to sort the dataset M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 63
MTB-02 Lookup Tables Using the same example we use Minitab s equivalent of a Lookup Table to add information to each row. We create a table of statistics to get a list of all the Products. Note: this example is so simple you would not need to do this but for more complex examples you would not want to create the list by hand. You might in fact read in information from a database or copy in a table of information from Excel, etc. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 64
MTB-02 Lookup Tables In this example we add in the batch weight for each product type by hand in column 8: Then we use Data > Code > Use Conversion Table to add the batch weight to each row Existing column whose values are to be define information needed from conversion table New column to be created with the looked up values. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 65
MTB-02 Lookup Tables Now the worksheet contains a batch weight for each row. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 66
MTB-02 Send Graph to PowerPoint If you right click on a graph one option is to Send Graph to Microsoft PowerPoint. This will create a new slide in PowerPoint containing the Minitab graph. PowerPoint will be opened if it is not already. My usual approach is to Copy Graph. Then in PowerPoint I paste it exactly where I want it in the document. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 67
MTB 02 Which Worksheet? You have multiple graphs open and you do not know which of the worksheets was used to generate the graph. How can you tell? M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 68
MTB 02 Which Worksheet? Method 1: Right click on graph This option on the pop up menu shows you the corresponding worksheet. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 69
MTB 02 Which Worksheet? Method 2: Expand the Graph Selection window: You can not only see the highlighted graph s worksheet but you can double click on any of the graphs to switch to it. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 70
MTB 02 Standard Footnotes Minitab has many customizable options. One for example allows you to add standard text to each graph you create: As new graphs are created they get the custom added footnote. M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 71
MTB 02 Review We learned how: To Change data types (e.g. from text into numeric) To override Minitab s default alphabetic Value Ordering of a column To make similar graphs to avoid having to recustomize Zooming a worksheet allows you to move around quickly To brushing point(s) of interest on a graph To use By variables to split graphs across panels or pages To upgrade graphs / time axes To use the Graph Layout tool To Subset while graphing To create a Secondary Axis for a scatterplot To create a Line / Bar combo graph using Project Lines M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 72
MTB 02 Review cont d (Cont d) We learned how: To do calculations using IF statements To Split or Subset a worksheet To create tables of summary statistics To use Lookup tables To create a Forward lag To copy graphs into PowerPoint To find out which worksheet generated my graph? To add a standard footnote to graphs M. A. Sibley Consulting All Rights Reserved MTB 02 - Intermediate Minitab 73