mtb 02 intermediate minitab®minitabmaestro.com/wp-content/uploads/2016/03/mtb-02... · 2016. 3....
TRANSCRIPT
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 1
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 2
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
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
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 3
D = Days; N = Nights
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…
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 4
The data is in International date format – by far the best!
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.
MTB – 02 Scatterplot vs Time
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 5
Let’s start with a simple graph of Strength vs Time
MTB – 02 Scatterplot vs Time
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 6
2012-01-012011-01-012010-01-01
100
90
80
70
60
50
40
30
20
Shift Start
Str
en
gth
Scatterplot of Strength vs Shift StartThis is good start
We notice a production gap.
This was an overhaul.
The gap in production would not have been obvious is a simple Time Series graph
2012-01-012011-01-012010-01-01
100
90
80
70
60
50
40
30
20
Str
en
gth
LSL
A
B
C
D
Crew
Scatterplot of Strength vs Shift Start
MTB – 02 Scatterplot vs Time
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 7
• 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.
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?
MTB – 02 Boxplots
• Let’s systematically look at this dataset. We
start with Graph > Boxplot > With Groups and
plot Strength by Crew:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 8
DCBA
100
90
80
70
60
50
40
30
20
Crew
Str
en
gth
Boxplot of Strength
C crew strength values look low, but is it statistically significant?
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
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 9
SlowMediumFast
100
90
80
70
60
50
40
30
20
Speed
Str
en
gth
Boxplot of Strength
It would make sense to list the speeds as Slow, Medium, Fast but Minitab will default to alphabetical. We fix on next slide.
MTB – 02 Value Order
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 10
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!
MTB – 02 Layout Tool
We click on one of the graphs to give it focus,
and then click on Editor > Layout Tool
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 11
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.
MTB – 02 Layout Tool
Our completed graph layout.
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 12
FastMediumSlow
100
90
80
70
60
50
40
30
20
Speed
Stre
ng
th
DCBA
100
90
80
70
60
50
40
30
20
Crew
Stre
ng
th
ND
100
90
80
70
60
50
40
30
20
Shift
Stre
ng
th
Boxplot of Strength Boxplot of Strength Boxplot of Strength
All three factors look like they might be statistically significant.
Let’s do a formal test.
MTB – 02 ANOVA
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 13
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%
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
The factor is significant (P value of 0.000) and explains about 9% of the variability in strength.
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:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 14
We use 2 since there are 2 shifts in a day.
MTB – 02 Run Chart
The data shows
all sorts of non
random
behaviour.
(OK this is a
“manufactured”
data set!) :
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 15
8007006005004003002001001
100
90
80
70
60
50
40
30
20
Sample
Str
en
gth
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
Run Chart of Strength
Some manufacturing processes exhibit differences based on day
of the week. Could this be happening here?
MTB – 02 Extracting Day of Wk
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 16
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!
MTB – 02 Assigning Formulae
Here is how we can assign a formula to a column:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 17
We type in the column name manually
The symbol shows that this column has a formula assigned. Any change to the input columns will update this column.
You can also assign formulae through the Calc > Calculator checkbox.
We right click on the new column
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:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 18
A repeat ANOVA analysis
using StrengthNotThursshows no statistical
significance. It looks like
the Weekend variable was
confounded with the
DayOfWk variable.
MTB – 02 Brushing
Brushing:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 19
We click on the Brush Icon (or click on the graph and then Editor > Brush)
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.
The highlighted points have their row shown in the Brushing window.
In the worksheet, highlighted rows are shown via a dot beside the row number.
MTB – 02 Brushing
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 20
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.
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.
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 21
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”
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!
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 22
You can see the new sheets in the Project Manager window
MTB – 02 Zooming
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 23
Holding down the <Ctrl>key and using the scroll wheel let you zoom the font size of the worksheet.
MTB – 02 Descriptions
• You can add column descriptions via right clicking
on the column:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 24
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!
MTB – 02 Multi-graphs
• We start with Graph > Scatterplot
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 25
Use of a By variable to split a graph into Panels
2012-01-012011-01-012010-01-01
100
80
60
40
20
2012-01-012011-01-012010-01-01
100
80
60
40
20
A
Shift Start
Str
en
gth
B
C D
Scatterplot of Strength vs Shift Start
Panel variable: Crew
MTB – 02 Multi-graphs
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 26
100
80
60
40
20
2012-0
1-0
1
2011-0
1-0
1
2010-0
1-0
1
100
80
60
40
20
2012-0
1-0
1
2011-0
1-0
1
2010-0
1-0
1
Crew = AS
tren
gth
Crew = B
LSL
Crew = C Crew = D
LSL
Scatterplot of Strength vs Shift Start
• 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.
MTB – 02 Multi-graphs
• We start with Graph > Scatterplot
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 27
Use of a Byvariable to split a graph into Pages
2012-01-012011-01-012010-01-01
100
90
80
70
60
50
40
30
20
Shift Start
Str
en
gth
Scatterplot of Strength vs Shift StartCrew = A
2012-01-012011-01-012010-01-01
100
90
80
70
60
50
40
30
20
Shift Start
Str
en
gth
Scatterplot of Strength vs Shift StartCrew = B
2012-01-012011-01-012010-01-01
100
90
80
70
60
50
40
30
20
Shift Start
Str
en
gth
Scatterplot of Strength vs Shift StartCrew = C
2012-01-012011-01-012010-01-01
100
90
80
70
60
50
40
30
20
Shift Start
Str
en
gth
Scatterplot of Strength vs Shift StartCrew = D
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
MTB – 02 Interactive
Upgrading of Graphs
• The resulting graph is a
little too busy to be very
useful.
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 29
2011-12-012011-11-012011-10-012011-09-01
200
150
100
50
0
Date
Ou
tpu
t
PORT BURWELL
PORTALMA-T1
PORTALMA-T3
PRINCEFARM
RIPLEY SOUTH
SPENCE
UNDERWOOD
WOLFE ISLAND
AMARANTH
COMBER
DILLON
GOSFIELDWGS
GREENWICH
GREENWICH-T1
GREENWICH-T2
KINGSBRIDGE
PAROCHES
Generator
Scatterplot of Output vs Date
• We can put each generating station in a separate
panel of the graph:
MTB – 02 Interactive
Upgrading of Graphs
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
MTB – 02 Interactive
Upgrading of Graphs
• This graph is much more readable
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 32
2011
-11-
26
2011
-11-
21
2011
-11-16
2011
-11-
26
2011
-11-
21
2011
-11-16
200
100
0
200
100
0
2011
-11-
26
2011
-11-
21
2011
-11-
16
2011
-11-
26
2011
-11-
21
2011
-11-
16
200
100
0
2011
-11-
26
2011
-11-
21
2011
-11-
16
200
100
0
AMARANTH
Date
Ou
tpu
t
COMBER DILLON GOSFIELDWGS GREENWICH
GREENWICH-T1 GREENWICH-T2 KINGSBRIDGE PAROCHES PORT BURWELL
PORTALMA-T1 PORTALMA-T3 PRINCEFARM RIPLEY SOUTH SPENCE
UNDERWOOD WOLFE ISLAND
PORT BURWELL
PORTALMA-T1
PORTALMA-T3
PRINCEFARM
RIPLEY SOUTH
SPENCE
UNDERWOOD
WOLFE ISLAND
AMARANTH
COMBER
DILLON
GOSFIELDWGS
GREENWICH
GREENWICH-T1
GREENWICH-T2
KINGSBRIDGE
PAROCHES
Generator
Scatterplot of Output vs Date
Panel variable: Generator
200
100
0
200
100
0
200
100
0
2011-1
1-2
5
2011-1
1-2
2
2011-1
1-1
9
2011-1
1-1
6
2011-1
1-2
5
2011-1
1-2
2
2011-1
1-1
9
2011-1
1-1
6
2011-1
1-2
5
2011-1
1-2
2
2011-1
1-1
9
2011-1
1-1
6
2011-1
1-2
5
2011-1
1-2
2
2011-1
1-1
9
2011-1
1-1
6
200
100
0
2011-1
1-2
5
2011-1
1-2
2
2011-1
1-1
9
2011-1
1-1
6
AMARANTH
Ou
tpu
t
COMBER DILLON GOSFIELDWGS GREENWICH
GREENWICH-T1 GREENWICH-T2 KINGSBRIDGE PAROCHES PORT BURWELL
PORTALMA-T1 PORTALMA-T3 PRINCEFARM RIPLEY SOUTH SPENCE
UNDERWOOD WOLFE ISLAND
Output by Wind Farm
MTB – 02 Interactive
Upgrading of Graphs
• After some edits:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 33
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
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
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 34
The dataset includes the time portion of the date/time
MTB – 02 Interactive
Upgrading of Graphs
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 35
<< We create a date + timevariable
The we format the column by right
clicking on the grey column header:
We select (or type in) yyyy-mm-dd hh:mm
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.
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
MTB – 02 Interactive
Upgrading of Graphs
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 37
200
100
0
200
100
0
200
100
0
2011-1
1-2
5
2011-1
1-2
2
2011-1
1-1
9
2011-1
1-1
6
2011-1
1-2
5
2011-1
1-2
2
2011-1
1-1
9
2011-1
1-1
6
2011-1
1-2
5
2011-1
1-2
2
2011-1
1-1
9
2011-1
1-1
6
2011-1
1-2
5
2011-1
1-2
2
2011-1
1-1
9
2011-1
1-1
6
200
100
0
2011-1
1-2
5
2011-1
1-2
2
2011-1
1-1
9
2011-1
1-1
6
AMARANTH
Ou
tpu
t
COMBER DILLON GOSFIELDWGS GREENWICH
GREENWICH-T1 GREENWICH-T2 KINGSBRIDGE PAROCHES PORT BURWELL
PORTALMA-T1 PORTALMA-T3 PRINCEFARM RIPLEY SOUTH SPENCE
UNDERWOOD WOLFE ISLAND
Output by Wind Farm
Can you see what additional edits have been made to the graph??
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:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 39
This creates a new column “Mean1”
which has, for every row, the average
output for the station appearing in that
row.
This option puts the average value on each line instead of creating a table
of average values
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
MTB – 02 Interactive
Upgrading of Graphs
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 41
2011-1
1-2
6 0
0:0
0
2011-1
1-2
5 0
0:0
0
2011-1
1-2
4 0
0:0
0
2011-1
1-2
3 0
0:0
0
2011-1
1-2
2 0
0:0
0
2011-1
1-2
1 0
0:0
0
200
150
100
50
0
Ou
tpu
t
AMARANTH
PRINCEFARM
UNDERWOOD
WOLFE ISLAND
Generator
Power Output for Major Wind Farms
After some additional
edits
MTB 02 Multi-Graphs Part 2
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 42
2011-1
1-2
6
2011-1
1-2
5
2011-1
1-2
4
2011-1
1-2
3
200
150
100
50
0
2011-1
1-2
6
2011-1
1-2
5
2011-1
1-2
4
2011-1
1-2
3
200
150
100
50
0
Capability*DateTime Output*DateTime
PORT BURWELL
PORTALMA-T1
PORTALMA-T3
PRINCEFARM
RIPLEY SOUTH
SPENCE
UNDERWOOD
WOLFE ISLAND
AMARANTH
COMBER
DILLON
GOSFIELDWGS
GREENWICH
GREENWICH-T1
GREENWICH-T2
KINGSBRIDGE
PAROCHES
Generator
Scatterplot of Capability, Output vs DateTime
After some additional edits
This may not be a very useful view here, but sometimes this capability is “just what the Doctor ordered”!
MTB – 02 Graph Layouts
Open in Minitab: NaturalGas.CSV
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 43
Data to be plotted
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)
Day into year. MMDD is that
date +1 converted into MM-DD format
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
MTB – 02 Graph Layouts
• The graph is pretty close to what we want right out of
the box:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 45
01-0111-0109-0107-0105-0103-0101-01
2500
2000
1500
1000
500
0
MMDD
Su
mC
on
su
mp
tio
n
2010
2011
2012
2001
2002
2003
2004
2005
2006
2007
2008
2009
Year
Scatterplot of SumConsumption vs MMDD
MTB – 02 Graph Layouts
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 46
01-0111-0109-0107-0105-0103-0101-01
2500
2000
1500
1000
500
0
MM-DD
Su
m C
on
su
mp
tio
n (
m*
*3
)
2010
2011
2012
2001
2002
2003
2004
2005
2006
2007
2008
2009
Year
Cumulative Consumption by Year
We edit the graph:
• Y axis label• X axis label• Title• Size of Symbols (1
to 0.75)• Connect lines (to
solid)• Add gridlines
MTB – 02 Graph Layouts
• Following a similar approach, we create a graph for
Cumulative Cost by Year.
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 47
01-0111-0109-0107-0105-0103-0101-01
1200
1000
800
600
400
200
0
MMDD
Su
mC
ost
2010
2011
2012
2001
2002
2003
2004
2005
2006
2007
2008
2009
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.
MTB – 02 Graph Layouts
• Here is how we do that:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 48
MTB – 02 Graph Layouts
• After some simple modification, here is what our
graph looks like:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 49
Much Better!
01-0111-0109-0107-0105-0103-0101-01
1200
1000
800
600
400
200
0
Su
mC
ost
2009
2010
2011
2012
Year
Cummulative Cost by Year
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
MTB – 02 Graph Layouts
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 52
01-0110-0107-0104-0101-01
2500
2000
1500
1000
500
0
MM-DD
Su
m C
on
su
mp
tio
n (
m*
*3
)
2010
2011
2012
2001
2002
2003
2004
2005
2006
2007
2008
2009
Year
01-0110-0107-0104-0101-01
1200
1000
800
600
400
200
0
MM-DD
Cu
mu
lati
ve
Co
st
2009
2010
2011
2012
Year
Cumulative Consumption by Year Cumulative Cost by Year
After clicking
Finish, we get this.
A thing of beauty!
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:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 54
We double click on the Y axis, select the “Secondary” tab and change the second line to plot on a secondary Y axis
MTB-02 Secondary Axes
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 55
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
MTB-02 Line / Bar Combo
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 56
We could stop here or continue to make this a bar / line plot.
We right click on the graph > Add > Data Display > Project Lines
MTB-02 Line / Bar Combo
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 57
1/01/121/01/101/01/081/01/061/01/041/01/02
500
400
300
200
100
0
1000
800
600
400
200
0
Mete
rsC
ub
ed
Deg
reeD
aysC
Natural Gas Consumption, Degree Days We click twice on one of the red project lines (where it does not overlap the black project line) and then choose type of none to get rid of this project line.
1/0
1/1
2
1/0
1/1
1
1/0
1/1
0
1/0
1/0
9
1/0
1/0
8
1/0
1/0
7
500
400
300
200
100
0
1000
800
600
400
200
0
Mete
rsC
ub
ed
Deg
reeD
aysC
Natural Gas Consumption, Degree Days
MTB-02 Line / Bar Combo
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 58
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
Note: consumption correlates very well with degree days except during the summer (when the main consumption is water heating).
Missing data!
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 59
MTB-02 Forward Lags
• Consider this data from a batch process:
• 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.
Open in Minitab:
BatchData.CSV
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 60
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 61
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 62
MTB-02 Forward Lags
• Here is a graph that can be generated with the data now available:
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.
2012-0
1-0
9 0
0:0
0
2012-0
1-0
8 1
8:0
0
2012-0
1-0
8 1
2:0
0
2012-0
1-0
8 0
6:0
0
2012-0
1-0
8 0
0:0
0
2012-0
1-0
7 1
8:0
0
2012-0
1-0
7 1
2:0
0
42
41
40
39
38
37
36
35
Pro
pert
yX
A
B
C
Product
O
O M
isse
d C
/O
O
O M
isse
d C
/O
Circled Batches precede product changes
Property X results for Batches
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 63
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
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
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 65
• 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.
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®
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 67
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.
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
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 69
This option on the pop up menu shows you the corresponding worksheet.
MTB 02 Which Worksheet?
• Method 2: Expand the Graph Selection
window:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 70
You can not only see the highlighted graph’s worksheet but you can double click on any of the graphs to switch to it.
MTB 02 Standard Footnotes
• Minitab has many customizable options.
One for example allows you to add
standard text to each graph you create:
M. A. Sibley Consulting – All Rights Reserved MTB 02 - Intermediate Minitab 71
As new graphs are created they get the custom added footnote.
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