# Q & A

Post your Minitab Data Manipulation, Graphing and Macro questions here…

## 182 thoughts on “Q & A”

1. Here is the gist of a question that I replied to in another forum.

Q: Can someone advise a conversion method for phone number formats?

I have (many!) phone numbers in multiple formats and I would like to convert them all to numbers for comparison. Example formats . 441235832566, +44 (01636) 613462, 1-613-531-1234, etc.

A: A very flexible way to strip extraneous characters is to use the underutilized text function “word”. It would allow formats like 1-613-324-1234, +44 (01636) 613462, 1-(613)-324-1234, 1 613 324-1234, (613) 324-1234, etc. all to be converted in one formula.

Here is an example that would get rid of the special characters “+”,”/”,”-“,” “,”(“,”)”. Note for some example example phones number some of the words returned would be a null strings – but that’s OK!

``` Let c2 = value(concatenate(WORD(c1,1,"+/- ()"),WORD(c1,2,"+/- ()"),WORD(c1,3,"+/- ()"),WORD(c1,4,"+/- ()")))```

2. Minitab vs Excel

I am a fan of Minitab(r) and Excel(r) but which to use?

Both!

If you are “fluent” in both you may find yourself using Minitab more than you thought for data manipulation. One example is the power of the “word” function mentioned in the previous post.

Here are some thoughts I posted in another forum:

Graphical analysis is at the heart of the practice of statistics. From my experience in manufacturing, graphical methods uncover most of the opportunities which get pursued. These opportunities are often solved in practical ways without the need for formal statistical methods.

Consider the benefits Minitab brings to graphical analysis:

• the ability to easily create panelled graphs and multiple graphs from one dialog
• no need to adjust data ranges for graphs if your dataset grows
• proper histograms without having to define bin ranges!
• statistically powerful graphs – ECDF graphs, Box Plots, Individual Values Plots, Matrix Plots, etc.
• the ability to overlay distribution curves, the ability to sub-set the data graphed, smooth ability to handle missing data, etc.

I’m not that familiar with more than the basic data analysis add-in for Excel, but Minitab out of the box “excels” at graphical analysis.

3. Q: How can I create a column with a moving average of the last three values for a variable?

A: Let’s say your variable is named Weight. You could use the following in the calculator function:

`rmean(lag(weight),lag(weight,2),lag(weight,3))`

You could also use Stat > TimeSeries > Moving Average and then Choose the Storage option.

4. Q: How can I create a column with row numbers corresponding to each value in another column? e.g. I have a column named Weight with values in rows 1 through 107. How can I create a column named RowNum that has the value of 1 in row 1, the value of 2 in row 2, etc. up to 107 in row 107.

A: The Partial Sum function adds up values in a column. The trick is to have it add a value of 1 for each row. By Boolean math an expression which evaluates as true returns a value of 1. We can combine this with the Partial Sum function to solve this problem. If our weights are always +ve numbers then (‘Weight’<>-999) will evaluate to 1.

So this is what we put in the calculator function:

`pars('Weight'<>-999)`

5. Scatterplot with Y axis “on top”, along with data labels…

There was a post in LinkedIn a few days ago which was removed
*******************************************************************
Dear Experts, How to create this chart in MINITAB?

Started by …….. …….., at National Institute of Oceanography
*******************************************************************

``` The graph was along the lines of: YVal 0 200 400 0 +------X--+---------+ | \ | \ | \ 30 | X D | / e | | p | / t 60 | X h | | ( | / m | / ) 90 | X 9 Deg. N | \ | | | \ 120 | X ```

Here is how to create in Minitab:

Let’s say we have 2 numeric columns Depth and YVal and a 3rd column
with a text value of “9 Deg. N” on the appropriate row.

1. We use the calculator function to create a column of Depth * (-1) so
that we change the sign. Let’s call the new column “Depth (m)”.
2. We create a scatterplot with connect line of YVal vs ‘Depth (m)’.
3. We right click on the connect line and edit it so that the
Options > Connection Order is “Increasing Y”.
4. Double click on the X axis and change
Show > Major Tick Labels to High Side and
Show > Major Ticks to High Side.
5. Right click on graph and Add > Data Labels… > Use Values from
Column and choose the text column.
6. Double click on the data label and change Alignment > Postion >
To the Right.

The only difference from the example is that the depths will be negative
numbers which seems OK. (If you were creating a macro to routinely plot
this data you could plot the negative values but labels the ticks with
positive numbers but that is getting complicated!).

6. Is there any dedicated training on Minitab application in India

• Not that I know of. A brief glance at the Training tab on the Minitab web site only shows North American sessions. I would be willing to teach in India (work permits allowing), but unless enough sessions were lined up it likely would be quite expensive.
Quickly Googling “Minitab training India” comes up with a number of hits.

7. I have 3 columns of data
1 column is criteria1
2 column is weight

3 column is criteria2 ( is different length than 1 and 2)
I would like to sum up the weight data where column1 matches the criteria in criteria2

I tried using a DO loop but that didn’t work. Anyone have any ideas?
This is the code I used in my macro

Name c15 “Sums” # Where I want the Data Stored
Let k10 = count(c1) # Number of rows

DO k31 = 2 : k10 # Number of rows to cycle through

# Like to sum up a row where criteria matches
Let ‘sums'[k31] = sumif(‘criteria1′,’criteria2′[k31]],’weight’,0)

ENDDO

• If I’ve understood your question you have 3 columns, for example:

``` Criteria1 Weight Criteria2 Blue 12 Green Green 14 Green Red 10 Red Red 8 Pink Red 12 Green Green 12 Green Red 11 Yellow Pink 10 ```

In this example you would want to sum the weights for matching colours.

If the columns have different numbers of rows you need to pad them to equal length. See the post for How To > Data Manipulation > Padding columns.

Once that is done the manipulations are straightforward:

Name C6 ‘MatchWt’ # Column with 0 for non match or weight if criteria match
Let ‘MatchWt’ = weight*(‘Criteria1’=’Criteria2’)

Name C7 ‘MatchWtSum’ # Cummulative sum of weights with matching criteria
Let ‘MatchWtSum’ = pars(weight*(‘Criteria1’=’Criteria2’))

After these manipulations the worksheet would look like:

``` Criteria1 Weight Criteria2 MatchWt MatchWtSum 0 0 Blue 12 Green 14 14 Green 14 Green 10 24 Red 10 Red 0 24 Red 8 Pink 0 24 Red 12 Green 12 36 Green 12 Green 0 36 Red 11 Yellow 0 36 Pink 10 ```

Is this what you were after?

Cheers – Mark

• Sorry took so long– that was what I was looking for.

Thanks

8. I am trying to establish the equation relating (2) columns of differnt lengths. Is this possible in MiniTab? Thanks,

• Yes but…

The data must be related on each row. Let’s say you are a teacher with 30 students listed in Column A. In column B you have the mark for essay 1. In column C you have the results for Essay 2 however there is no data for the last 3 students.

You want to create a fourth column with the difference between the two marks, however the calculator will complain if you try to use two columns of differing length. The simplest work around is simply to go to the cell in column C on the same row as the last row of data for column B and enter an asterisk which is Minitab’s missing data symbol. Now you should be able to do the calculation without complaint. Any row with a missing mark in either essay mark column will lead to a missing data result in the Difference Column.

Good luck.

Mark

• Hi Mark, Thanks ! But… The situation I am dealing with is (2) sets of Data:

1) Before Heat Treat and plating
2) Completed Parts

I’m trying to correlate the (2) sets of data with an equation to accurately determine the Specs prior to finishing.

The Sample Sizes are different and it seems incorrect for me to eliminate data from the 1st sample. So, how I handled it was to duplicate the final data to fill the column… That seemed to work fine but I was hoping there were other people that have run into this situation and maybe could add additional ideas.

Thanks a lot for your feedback.

Tim

• This situation raises a number of questions. You have essentially a 2 sample t-test situation, however…

A two sample t-test is looking to see if there is a statistical difference between the 2 sets of data in the mean value. To get reasonable results you need to have roughly normal distributions of the before and after data sets. You are also looking to set specifications. I’ll make use an example to illustrate a potential approach. Lets say you have on aim process control with aim of 18 and specifications of +/- 2 units.

You do your 2 sample t-test and get the following result:

`Two-sample T for Before vs After`

``` N Mean StDev SE Mean Before 23 14.475 0.931 0.19 After 29 17.844 0.854 0.16 ```

```Difference = mu (Before) - mu (After) Estimate for difference: -3.369 95% CI for difference: (-3.874, -2.864) T-Test of difference = 0 (vs not =): T-Value = -13.44 P-Value = 0.000 DF = 45```
This is telling you that there is a difference between the 2 samples that is unlikely to be due to chance. One way to set the “Before” specifications would be to say that you normally control to an aim of 18 for the “After” case and the treatment causes a rise of 3.4 units so you could set your limits for the before case to a LSL of 16 – 3.4 and the USL to 20 – 3.4. However this is making 2 assumptions:

1. That if the process was brought on aim by raising the process from the observed 17.8 to 18 that the “Before” would also need to go up by 0.2 units. This seems reasonable.
2. That the variability of the process does not change from the “Before” to the “After” case. This is not necessarily the case. We can test this statistically using Stat > ANOVA > Test for Equal Variance. (We must first stack the 2 columns). In my example the test showed no difference in variance so I can feel that the approach of just subtracting 3.4 from the current LSL and USL is reasonable. Note that estimates of variance need lots of data to be accurate.

I hope this covers your situation…

Good Luck – Mark

9. Hi Mark,

Very cool site! Landry suggested I contact you with this question…. I have been asked to compare 2 samples (test vs control) to determine if they are the same or different. The testing is a discrete pass/fail but can also be evaluated as ordinal data depending on how you look at it. I have arranged a sample data set below where 10 tests at each level were completed.
Scenario 1: Evidence of Failure Gradually increasing after Level 6
Test Level Control Test
Level 1 10 10
Level 2 10 10
Level 3 10 10
Level 4 10 10
Level 5 10 10
Level 6 9 9
Level 7 9 8
Level 8 8 7
Level 9 8 5
Level 10 5 1
Level 11 5 0
Level 12 1 0
Where I would like some help is; what tool can best compare the 2 data sets and how many samples should I be analyzing to detect a difference with 95% confidence. …. Thx John

10. John,

It is good to hear from you.

This question is outside of my area of experience & expertise so I’m hoping that by posting this, someone with experience in this area will reply.

One way to think of this is as a power and sample size question for 2 proportions. For instance if you have a proportion of 0.6 vs 0.25 and ask Minitab for the sample size needed to see this difference with 95% power you get the answer of 49.

One nice way to visualize this data is by Graph > Scatterplot > With Connect Line and then put in Line 1 of the Y vs X: Control and Level and in Line 2 of Y vs X: Test vs Level > then click “Multiple Graphs” and click on “Overlaid in the Same Graph”. (Scroll down through the sample graphs page to see this graph).

Thoughts from others??

• Thanks Mark, I’ve been also working with Jonathan Mann and the sample sizes that we have been calculating have been in the order of 1000’s and so we have adjusted the analysis in an effort to make the data more continuous. Now instead of multiple samples at each level graded as a pass or fail, we are running each sample through each level and recording the value at which it fails. What we end up with unfortunately is data that cannot be tested for normality due to the nature of the levels in the test. My probability distribution in the normality test looks like the following graph (please past it into notepad for better view). It passes the ‘pencil’ test for normality but can you recommend what test could be used to check for normality. Assuming it passes this then my belief is that a 2-sample-t would allow me to test for a difference. I have also included my dataset below if you would like to test for normality.
+ .
| :
+ : .
| . :
+ :
| :
+ : .
| .
+—+—+—+—+—+
Dataset:
Test_A
600
550
600
650
500
600
600
700
550
750
750
600
450
550
550
500
500
650
550
650
700
400
750
750
600
600
600
600
650
700
700
700
500
750
600
500
600
550
650
400
600
550
600
650
600
700
650
600
550
600
600
650
800
750
650
750
650
700
700
500

11. Ignore the notepad comment, when the comment was published it deleted the spaces. If you plot the dataset on a probability distribution you should be able to see what I mean.

• John,

When it comes to testing normality your “pencil test” thought is a good one. If the sample size is very large a test for normality will almost always fail – however that is not your issue here. Another simple approach is to graph the data as histogram with the normal curve with matching Xbar, S overlaid. (Graph > Histogram > With Fit). There is nothing obvious with your data which would suggest non-normality.

Each statistical test has its assumptions about the data being supplied for testing. The Anderson-Darling test fails when goes up in steps. I encountered an example of this when lab data was being reported to 2 digits when the 3rd was significant. The data failed the Anderson-Darling normality test. It can do so even when the data passes the “10 bucket” rule!!

If you use the Ryan-Joiner test you no longer see evidence of non normality. Given the “pass” on this test and the problems with Anderson-Darling for this type of data I’d say assuming normality is warranted.

12. I have a question how to format axis labels in MINITAB. For example I want mm square with 2 as superscript but not like mm^2.

• I am on vacation so I don’t have access to Minitab. I know you can format the text but I don’t think you can change within the string.

Does anyone with access Minitab have any suggestions?

• Joseph,

Here are replies to a similar question posted in another forum (LinkedIn Minitab Network):
================
Keith Jewell • I haven’t found a general way. Sometimes I’ve achieved the effect by adding a separate textbox with the sub/superscript in a smaller font, but that’s a bit awkward and fragile.

You can copy/paste from the ‘Character Map’ utility; on my Windows Server 2008 computer that is at Start > All Programs > Accessories > System Tools. As well as copy/paste, many characters show a “Keystroke” sequence for entering characters direct from the keyboard without having to open Character Map. Many of these are a combination of “hold Alt down and enter a 4 digit sequence on the numeric keypad”. The list pinned over my desk includes:
—————
Alt+0185 superscript one ¹
Alt+0178 superscript two ²
Alt+0179 superscript three ³
Alt+0176 degree sign °
Alt+0177 plus-minus ±
———————
Depending on your font, in Character Map you may find quite a few other superscripted letters/symbols as “Modifiers”.

All these are font dependent, so be careful. Moreover, sometimes I’ve found them to disappear when I’ve copy/pasted the graph into a MS Office document 🙁

I haven’t found a really acceptable way of doing it, so please add a followup if you find other ways.

Hope that helps,

Keith J
========
Paul N Sheldon • Keith has illustrated what I have done for years (and by the way this works in many applications – I first learned them for MS Word). To avoid disappearing embellishments, save the graph as a JPG rather than MGF file and then insert it. Unfortunately expanding the text styles in Minitab would require that it be possible on a character by character basis rather than the entire text as styles are now applied.
========
As the original poster points out – this method does not work well if you are dealing with large numbers of graphs (eg. output from a macro or split via a By variable).

Good Luck

• Another thought for “ugly” but easy workaround similar to one of Keith’s suggestion.

Use the regular (i.e. non super/subscript) text as the axis label, and then just add a footnoote with the Superscript or Subscript text. Choose the font size and position the text appropriately to look as if it were part of the same text string as the main label. “Bob’s your uncle” – you have your pretty axis label!

This approach is easily incorporated into a Minitab Macro.

Keywords: superscript, subscript, axis label, Minitab, footnote

13. I have two worksheets I am trying to merge, I have a problem with the columns I am using to Match.
Both worksheets are concatenating some data Eg:
Concatenate C10 ‘Text string’ ‘Spin_Mach’ ‘Shift_Code’ c10. I then use this try to match worksheets, unfortunately one of the concatenated columns has a space on the end of it, so of course they don’t match.
Can I add a space to the one column?

• Yes, use the Concatenate function in the calculator.
CONCATENATE(YourColumn,” “)

14. I am new to Minitab. I am trying to determine whether the amount of change indicated in responses to questions in pretest and posttest data are significant. The pretest and posttest questions are identical. Can someone instruct me on how to set-up and run two proprtion tests for a single question, using 30 participants and a choice of 4 possible answers (1, 2, 3, or 4)?

15. Mark, I’ve enjoyed your comments on LinkedIn and looked at solutions here. I’ve done many of the “tricks” you demonstrate. I just checked your demonstrations for custom symbols and did not find what I’m looking for — wind barbs!

A bit of history …
I’m a member of the Technical Committee for the Clean Air Coalition of Western NY. We are collecting some particulate measurement data in conjunction with a local college. I’d like to be able to plot data from one of the continuous monitoring units as a function of time using the wind barb as the plotting symbol. Now the wind barbs show both approximate wind speed and direction. All of the custom symbol methods we both have used depend on the character set being already available. Have you ever truly developed customized symbols? Ideas?

I know monitoring of various pollutants is done at many industrial facilities. I think the ability to use wind barbs as plot symbols would be much appreciated.

16. Paul,

If you look in the “How To” section, I’ve added an explanation of how to do this.

Cheers – Mark

17. Hi Mark,

Very cool website. I have a problem that (in my mind at least) should be easy to fix. However, I have been frustrated so far in my attempts to do so. I am trying to find a way to automatically update charts in a layout. I have 40+ charts that are updated regularly and then put into 10 different layouts. This is rather time consuming to say the least!

Do you know of any way this could be automated?

Thanks for the help!

• My apologies for the delay in replying… see explanation in a later post…

I think the approach that would work best is to use macro code. I might post all of my training material, but for now I’m holding back some stuff for my paying clients!

The general approach to build your macro:

Create an near empty macro file in Notepad or an other “plain text” editor. eg. MyGraphs.mac
(Not Microsoft word). Remember to Save as type “All Files” so you don’t have the name come out MyGraphs.mac.txt

Create your graph, customize it as needed, then use Editor > Copy Command language to get the corresponding macro code. Paste that into the macro file. Keep doing this for each graph.

To put them into a layout you need the macro commands

Layout; and then after the graphs

EndLayout.

You will also need to add in a Figure command in each graph’s macro code to specify the x, y locations for the corners of the panel of the overall graph that you are creating.

This is a rough overall outline.

See the Weibull Analysis example in the How To tab of this website for a worked example of a complete macro which includes multi-panelled graphs laid out via the Layout command.

Good luck and feel free to ask more questions… hopefully they will get answered sooner!!

18. What is the least amount of samples needed to create a capability sixpack in Mintab? I tried with 11, and it did not work, but it seemed to work fine with 22 samples.

• My apologies for the delay in replying (I have the explanation in a post below)…

Process Capability is used to assess the ability of your process to meet specifications. Inherently, this means you are trying to understand the variability (and location) of the process. Trying to do so with 11 samples is not reasonable. Somewhere in the range of 25 points is a minimum as long as it is over a long enough time to include “long term variability”.

Cheers – Mark

19. I’ve just started using Minitab to analyze testing data, and I was hoping you may be able to give me a little advice. The tests I’m running return a very large number of data points (~90,000), which makes analysis a headache. Is there any way to get Minitab to cut down on the data by only using every 100th value or a similar number?

• I am embarrassed by how long it took to get to this comment. It came in while cruising the Mediterranean, then my daughter got married, we have the grandchildren staying with us, part time employment, the 8 scheduled activities per week, blah, blah…. Right.

Minitab can handle large datasets pretty well, but if you want say every 100th value you can subset every 100th row of the dataset by using

Data > Subset

and use the “Rows that match condition” and then, if one of your columns of interest was named “myvar”, you would enter your condition as:

mod(pars(myvar<>-9999),100)=0

Explanation:

Assuming your column name “myvar” does not include the value -9999, then the condition (myvar<>-9999) will always have a value of 1.

The Partial Sum function (pars), adds each successive row to the cumulative sum so far. So if each row has a value of 1, then the partial sum will be 1 for the first row, 2 for the second, tec.

The modulus function (mod), returns the remainder after integer division by the value specified, thus mod of a value by 100 will return 1 if the value is 1, 2 if the value is 2, 99 if the value is 99, 0 if the value is 100, 1 if the value is 101, etc.

So in total the expression, mod(pars(myvar<>-9999),100)=0 returns row 100, 200, 300, etc.

Cheers – Mark

20. I have a series of text data all with varying lengths but all with the same format as below:
VCL01-W38 G7
VFHG14-W31 20
VX8-W33 G3

I am looking to filter out all data after the “-” leaving the first text string only. How would I go about doing this?

• Alex,

Minitab has a wonderful text function called “word”. It is available via the calculator. It has three parameters: the input string, the word you want and optionally delimiters. In your case your delimiter is the minus sign.

So if you have your text strings in column 1, you would call up the calculator (Calc > Calculator), Store the result in say Column 2 (C2), and enter the expression as

word(C1,1,”-”)

Cheers – Mark

21. hey I was wondering how can I do multiple moving average forecasts? I have more than 1000 data and I don’t want to click stat>time series>ma every single time

• Sorry for the delay in replying… life got in the way.

A basic approach might be to create a macro. After you run Stat > Time Series > Moving Average the first time, go into the history window and look at the session code commands that are created to create your forecast. You can then copy these commands and create a macro with a loop changing the parameters to have the command run many times with different forecasts. (Note: you need to go into Tools > Options > Session Window > Submitting Commands and enable the command language prompts. There are many references, including Minitab’s Help > Help > Macros that can guide you on creating and executing macros).

Good Luck – Mark

22. I have created a few SPC charts which automatically updates itself from an excel file via ODBC and hotlink. The thing is that the chart windows will overlap each other when the chart refreshes and user have to manually drag the charts to different areas in the page to see all charts in a glance. I suppose layout wouldn’t work as it just sort of combine 4 charts into 1 chart which is not what i wanted. Please help me on this one. Thank you!

• I’m not sure exactly what you are trying to do but…

Interactively the user can select the “Show Graphs Folder” icon, and then select all graphs (by the usual Windows approaches of Ctrl/A or click first graph, hold shift and click last graph, etc.), right click and select “Tile”. You cannot do this with macro code. Minitab’s VBA interface likely could do tile graphs.

You can use layout as you mentioned, but if you have a dynamic list of charts it can get tricky. You can dynamically select the graphs to include in the layout by creating a table of say machines, products, properties or whatever it is you are using to create your different SPC charts by Stat > Basic Stats > Store Descriptive Statistics. Then with macro code you can step through each of these products, etc. creating each quadrant of a 4 graph layout, moving on to the next 4 graphs, etc. until all graphs are complete. When I’ve done this I then label the graphs as Page 1 through N and provide links to the pages on a web site so the user does not to even use Minitab to look at the graphs. See the auto-jobs section of this web site for more information.

• I’ve made a macro to create charts (control charts -> Individuals) including stages. Because stage text overlaps, I put the text manually on an angle of 45 degrees. Is this also possible within the macro (code). History doesn’t show the changes.

• Absolutely. Once you have modified your graph to your satisfaction, make sure your graph has “focus” by clicking on it and then select Editor > Copy Command Language. The necessary macro commands for generating the modified graph are now in the clipboard, ready to be pasted into your macro.

Good Luck!

23. I am trying to use a macro in minitab16 to do the holt’s forecasting method. I write the codes/rules in notepad and call them from within minitab. I need to know how to get the sum of all the values from a column. e.g. column 1 has values 1, 3, 4, 10….. I need it to do the sum of these an display this value in another column so it can be used for further calculation, how can I do this? thanks

• never mind I figured it out, was simple. It didnt work before because the code included a row for the column so it would only sum the cell not the column, I fixed it now, thanks

• Sorry,

I was cleaning up comments and I noticed this question was unanswered.

In command/macro language you can store the sum of a column in another column as simply as

Let c99 = sum(c1)

or if you had suitably named columns

Let MySum = Sum(MyColWithValues)

24. how to express this equation in minitab
LET CK4(K3)=CK1(K3)-(0.1*CK1(K3-1))-(0.8*CK1(K3-2))+(0.3*CK1(K3-4))-(0.9*CK1(K3-8))-(0.03*CK1(K3-5))+(0.09*CK1(K3-9))-(0.24*CK1(K3-6))+(0.72*CK1(K3-10))
I got an error that the expression is too complicated so i tried to split it into two but it caused the minitab to exit.
Any help?

25. Sorry for the delay in commenting. I split your expression which appears to be creating some kind of weighted sum of previous rows as shown and it worked without issue:

Let K1 = 1
Let K3 = 11
Let K4 = 3
Let K5 = 4
Let K6 = 5

Let CK4(K3)= &
CK1(K3)&
-(0.1*CK1(K3-1))&
-(0.8*CK1(K3-2))&
+(0.3*CK1(K3-4))

Let CK5(K3)= &
-(0.9*CK1(K3-8))&
-(0.03*CK1(K3-5))&
+(0.09*CK1(K3-9))&
-(0.24*CK1(K3-6))&
+(0.72*CK1(K3-10))

Let CK6(K3) = CK4(K3) + CK5(K3)

26. I created a DDE link for minitab to an excel file to extract the data into minitab when the source excel changes the values. The excel file is saved in a common drive. I have a problem: The DDE link worked fine when i open the excel source file from my workstation but would be disconnected when i close the excel from my workstation and open it from another workstation. i could not re-establish connection when i open the excel source file from another workstation. Is there a way to over come this?

27. I’ve had limited experience with Minitab automation. The approach I’ve used is to periodically initiate a Minitab macro via the Windows Task Scheduler and then read data from Excel via the ODBC command.

I’d call the Minitab help desk with this one. They have been the best help desk I’ve dealt with over the years!

Good Luck – Mark

28. Many good tips. I am trying to reverse the order of the numbers on the x-axis. I want negative numbers to start from zero and increase on the right side of the graph instead of left. Also, I want positive numbers to start from zero and increase on the left side of the graph instead of the right.

• One might ask why? There is a work around to do this but it is ugly.

Say your X axis variable has the clever name of X. Use the calculator function to create a variable XReverse where is it = to X*(-1).

Then plot your Y variable vs XReverse. Now you need to fix the axis. Double click on it and on the Scale Tab under Major Tick Positions in the Position of Ticks: box put in reasonable values for the ticks you want. Say your X values go from -7.3 to 5.2 then your XReverse values should go from -5.2 to 7.3 so reasonable tick values would be -6, -4, -2, 0, 2, 4, 6, 8. The short form way to enter this would be -6:8/2. Now you need to give those ticks the opposite sign labels. In the Labels tab click under Major Tick Labels click on Specified: radio button and in the box enter the labels as 6 4 2 0 -2 -4 -6 -8.

I did warn you it was ugly!

29. i have two different xyz contour graph in minitab. i want to superimpose one over the another.Kindly reply me to do this.

30. As far as I know, you cannot directly overlay two contour plots. However, if you
follow the basic steps I outline in the “How To” section entitled “Layout – 2 plots
overlaid” you can do it.

Basic Steps:

.. 1) Generate your 2 contour plots and make sure you select the “Contour Lines”
….. option on the “Data Display” button.

.. 2) Edit them to change the colour &/or widths of the contour lines so they
….. will be distinguishable when overlaid.

.. 3) For the second graph, move the legend vertically down so the bottom of the
….. legend lines up with the bottom of the Data area.

.. 4) Click on the data area of the first graph and make it slightly wider or
….. narrower. When you capture the commands to generate the graph, you will
….. seethey include a “Data” command. You will use the same data command so
….. that both graphs overlay exactly on top of each other.

.. 5) Click on graph 1 to give it focus and then click on “Editor > Copy Command
….. Language”, open notepad and paste from the clipboard. Do the same for
….. graph 2 pasting it below the code for graph 1.

.. 6) Edit the code to:

……. add a “Layout” command on the first line, and an “EndLayout” command
……. at the end of the file.

……. Copy the “Data” line from the first graph and paste it into
……. graph 2 so that both graphs will have the same X & Y co-ordinates for
……. the data area.

……. Add the line “Type 0;” after the “Data” command line for graph 2. This
……. will make it transparent so you can see the graph underneath it.

……. Add the same quoted text after the “Title” commands for both graphs.
……. (see e.g. below).

.. 7) Copy all the text from notepad into the clipboard, switch to Minitab and
….. press Ctrl/L.

.. 8) Paste the text into the command line editor window (via Ctrl/V) and then
….. press “Submit Commands”. Viola! Hopefully you will see a beautiful graph!

Note: you could add a few lines to the top and bottom of the file and make it a
macro.

Here is the code from this example.

``` Layout Contour Z * Y * X; NoArea; Distance; Power 2; Data 0.0859 0.8526 0.1245 0.8701; Legend 0.8874 0.9755 0.6757 0.8701; Section 1; Connect; Type 1 1 1 1 1; Color 12 8 57 18 129; Size 3 3 3 3 3; AttSet 2; Title "Contour Plot of Z, Z2"; Footnote; FPanel; NoDTitle. Contour Z2 * Y * X; NoArea; Distance; Power 2; Data 0.0859 0.8526 0.1245 0.8701; Type 0; Figure; Type 0; Legend 0.8772 0.9752 0.1323 0.3877; Section 1; Connect; AttSet 2; Title "Contour Plot of Z, Z2"; Footnote; FPanel; NoDTitle. endlayout ```

31. How can I automatically adjust rows and columns for various panles through commands

32. Hello Ashish,

I’m catching up after vacation!

I’m assuming you mean session or macro commands. I’m assuming by “panles” you mean panels within a graph? If so…

You need to use the commands Layout, Endlayout, Figure, etc. See this example:

``` # Create Layout - scatter & boxplot```

``` Layout; Title "Consumption vs Days Between Fill Ups"; SubTitle k1; PSize 8; TColor 4; Center; gsave "C:\MTB\Output\Home\CarDaysBetween.jpg"; replace; jpeg. # Scatter Plot Plot 'Consumption(L/100Km)' * & DaysBetweenFills; Include; Where "(DaysBetweenFills<>'*')and(DaysBetweenFills>=0)"; Figure 0 0.5 0 1; Scale 1; MODEL 1; Min -0.2; EndMODEL; AxLabel 1 "Days Between Fills"; ADisplay 1; NoJitter; Data 0.1576 0.9412 0.0976 0.9486; Legend 0.6753 0.9035 0.1204 0.2158; HBold; Section 1; CHeader 2 "Season"; Regress; Symbol Season; Type 6 16 16 20 23 26 29 2 3 4; Color 4 2 52 4 42 6 84; Size 1 1; Grid 1; Grid 2; Footnote; FPanel; NoDTitle. # Plot os BoxPlot Boxplot 'Consumption(L/100Km)' * & DaysBetweenFills; Include; Where "(DaysBetweenFills<>'*')and(DaysBetweenFills>=0)"; Figure 0.5 1 0 1; AxLabel 1; ADisplay 1; Label "Days Between Fills"; ALevel 1; SOffset; IQRBox; Individual; Type 16; Color 73; Size 0.66; Outlier; Mean; Type 6; Color 2; Size 1.3; Footnote; FPanel; NoDTitle. ```

``` endlayout. ```

I’ll post a the output of the graph in the sample graphs tab…

33. Hi,

I am very new to Minitab. I would like to know if there is a macros code that will enable a command (in this case a calculation… a series of partial sums of select columns) to repeat (loop) through numerous worksheets.

I have my data (EEG amplitudes) for 20 participants in 20 separate worksheets within a single project. The column headings are the same in each worksheet…. so I need to essentially repeat the same partial sums calculations in each sheet.
How can I get my macros to loop through all worksheets?
Thank you!

• Rebecca,

Here is a macro that might show the steps:

(Unfortunately the indenting is lost when I post this!)

``` # MAS_Sheets.mac - Macro to demonstrate selecting various sheets # # M.A. Sibley Consulting, Kingston, Ontario. Copyright 2014 # # 2014-08-25 MAS - New macro```

``` gmacro MAS_Sheets echo # Create & Name blank worksheet from which to call data worksheets new. worksheet; rename "HomeSheet". # In this example we have worksheets MySheet1, MySheet2, MySheet3 Let k10 = 3 # Suffix number of sheet DO k11 = 1 : k10 # Create text string with name of worksheet Let k12 = Concatenate("MySheet",text(k11)) # Open the worksheet worksheet k12 # Do required manipulations, create output, etc. Name c2 "MySum" Let MySum = Pars('MyCol1') # Return to home worksheet worksheet "HomeSheet" ENDDO # Close home worksheet worksheet "HomeSheet"; close; noprompt. ```

```endmacro ```

I have 3 months, 4 plot sizes and 3 behaviors. I’ve been doing plots of ‘sizes v. behaviors’ and ‘months v. behaviors’-they have gone fine. I am wanting a box plot of ‘month and size v. behaviors’. So for the graph to have the months right at the bottom and then the plot sizes as sub divisions of this

y-behaviors
x- sz1 sz2 sz3 sz4 sz1 sz2 sz3 sz4 sz1 sz2 sz3 sz4
May June July

I’ve got the graph fine, the sizes are entered in the right order but the issue is it is listing the x axis as ‘July, June May’ instead of ‘May, June, July’. The data is entered chronologically and I’ve tried switching it but it wont change. I can’t seem to order the months how I want and have been googling ways to do this for over an hour-no luck. Please please someone help me, I am stuck!

Thanks

• I suspect your column with the Months is a text column. Minitab’s default is to plot such a column in alphabetical order. To change this, right click on the month column, choose Column > Value Order and then select Order of Occurrence in the Worksheet.

Alternatively, you could change the column to a date column. Data > Change Data Type > Text to Date/Time.

Cheers – Mark

35. But now I have an issue with my plot sizes
I am also wanting to arrange those, under the months

e.g.
May
sz1, sz2, sz3, sz4
June
sz1, sz2, sz3, sz4
July
sz1, sz2, sz3, sz4

But I am now getting
May
sz2, sz3, sz1, sz4
June
sz2, sz3, sz1, sz4

I have tried the value order again but I cannot seem to get both Months and plot sizes to order themselves. Any tips?

Thanks

• I take it by plot size you are referring to a column variable named plot size. If your data is text with values of sz1 to sz4 then the default value order for this column is alphabetic.

Did you by chance change the Column > Value Order of both the Month *and* PlotSize columns? You can right click on the PlotSize column and change the value order back to alphabetical.

If this is not the problem, then I need more information… Good luck.

36. Friedmans test assistance!

Need to do a friedmans, looking at a rate of behaviour, over plots (1, 2, 3 and 4) and replicates (1, 2, 3 and 4)
I keep getting an error saying:

Friedman ‘AV’ ‘Size’ ‘Replicate’.

* ERROR * Must have one observation per cell.
* ERROR * Completion of computation impossible.

I have tried removing all observations of 0, I have rounded numbers to whole numbers and have tried various times looking at different factors.I keep getting this error and I don’t understand why. Have tried to find tutorials etc on the internet but cannot find any one else who had had this issue so have no idea how to resolve it, any ideas?

I’m on Minitab 16 and any help would be greatly appreciated

Thanks

• I think your problem is that your observations do not cover all the combinations of treatments and blocks. If you have 6 treatments and 2 blocks do you have all 12 combinations of treatments and blocks?

If the problem is something else, I’d suggest calling Minitab’s support desk. They are excellent!

37. Is there a way to use the Code function to pick out data that is NOT equal to something?

I want to pick out a set of 10 labels from a large group of data and create a new column identifying them as group A, and the rest as group B. Currently, I can define the set of 10 and call that group A, but everything else gets its original name put in the new column. I would like to identify everything that is NOT group A and set that to be group B, but I don’t know how to ask Minitab for “not equal to”.

38. This has been a wish list item with Minitab – i.e. have an “other” category when coding data. Minitab defaults to leaving the data unchanged if it is not listed in the code table.

Two approaches:

Method 1:

Create a table of the column with the labels (e.g. with Stat > Tables > Tally Individual variables – and check the store results button).
Then create a new column beside this tally listing. Lets say we call this column MyGroup. In the MyGroup column beside the appropriate row in the tally table we enter which group the value belongs to: A or B in your example.

Then we use Data > Code > Use conversion table. In my case the original column with labels was named Categ and my Tally column with the values of the labels is Tally1. So in the conversion table I enter:

Input column: Categ
Output column: Group

Conversion Table

Column of original values: Tally1
Column of new values: MyGroup

This should create a new column named group with the values you want.

Method 2:

This works if the list of possible categories is small enough in the first group.

Use Calc > Calculator and enter in the formula box something along the lines of:

where “aad” through “s” are the categories in Group A.

Good Luck!

39. I am setting up control charts for an SPM program and i would like to control the time frame displayed on each chart. The charts would be updated regularly with new data and the amount of points in the time frame could vary greatly. Minitab only allows me to display a specified number of previous points in the chart options. I would like to display the previous “45” days. Days without data would not be used. Example, 90 days from September 30th is August 15th, all my charts should show August 15th as the first data point even if there was a week where the equipment wasn’t used early in September. Currently if i just put 90 data points i will get August 8th as the first data point. I expect to be able to do this through macros but i have never tried before. Does anyone know if this is possible?

• Let’s assume your date/time variable is named DateTime.

When you generate your control chart one of the buttons available in the dialogue is “Data Options”. If you click on the “Rows to Include” radio button for “Rows that match” and then press the “Condition” button beside it you should be able to put in a condition like “DateTime>max(DateTime)-45″ if you want it based on the latest data point or “DateTime>now()-45″ if you want it to include points based on today’s date.

You could also sub-set the worksheet based on date, but the above approach is pretty direct!

Let me know if this does not solve your problem.

Mark

• If i use the “Data Options” button to exclude data based on date it will not use that data to calculate the control limits. Essentially putting a stage gate in 90 days ago every day. This would not meet my needs.

I am thinking i need to write a macro that looks at the last data point date, subtracts 90 days from it, counts the number of data points in that time frame, and inserts that number into a variable that can be referenced in the “Display” subcommand.

I have no idea if that is possible or if there is a more elegant way to do it.

• The recommended practice when creating control charts is to do an analysis to understand the “Voice of the Process“. This typically is done by analyzing 30 to 60 data points using the control chart of interest with special cause points excluded.

Let’s use an I-MR chart as our example.

In Minitab you can use Stat > Control Chart > Variables Charts for Individuals > I-MR and once you’ve chosen your variable to control chart you can click on the “I-MR Options…” button on the right. You can then exclude your known special cause points (i.e. points that had something known to cause them to be unusual vs simply points in alarm) under the “Estimate” tab. You can also use the “Storage” tab to output the mean and standard deviation estimated from your data.

After that point the practice is to generate future control charts using that mean and standard deviation until the “Voice of the Process” says you should change them – e.g. you improve the process and see lower variability. To specify the mean and standard deviation you use the “Parameters” tab in the same Options dialogue.

If you specify the mean and standard deviation you do not need to worry that you are only displaying the last 45 days worth of points.

(In most cases I’ve created a macro to generate the control chart, but simply to save time and prevent errors as the data usually exists in a database somewhere and it is straightforward to create a Minitab macro to go into the database (if it has ODBC access), pull out the data of interest, run the control chart and save it as a JPEG file that can be linked to a web page. However, I’m getting off topic!)

Again – let me know if this does not answer your question – Mark

40. In minitab 16 do control chart control limits continually recalculate as new data is added? How can control limits be locked? Can you select the portion of the dataset to use for calculating control limits and then lock them for future data?

• Yes, by default in Minitab a control charts limits recalculate based on the data charted. The previous question takes you through how to “Lock In” the control limits used by specifying them within the Parameters tab.

As a general principle, once you have established the “Voice of the Process” you *should* lock in the limits until you have evidence that the Voice of the Process has changed.

41. Thanks Mark for all of the great tips on this site. I have a simple question which I have called the Minitab support line about, and they stated it might be a feature for the future, but cannot be done with Minitab 17. I thought that maybe you might have ideas or a workaround.

I would like to produce a Minitab interval plot with x-axis data that has uneven spacing. For example, I might want to produce a plot of the mean +/- 95% CI of the world population from the years 1000, 1500, 1900, 2000, 2010, 2014. If I were to try this, the points would be evenly spaced on the x-axis, even though in reality they are not. This gives a false impression of the trend with respect to the x-axis (years). I can properly space the means with a Minitab scatterplot, but then cannot add interval bars.

To further clarify, to do this in MS Excel, I would simply make an X-Y scatterplot with the means, then add y-error bars.

Have you encountered this before? Any thoughts would be appreciated. Thank you.

• For discussion purposes, suppose you have 4 columns:

— Year
— Population
— LowEst
— HiEst

One simple way to get a usable, albeit not pretty, graph would be to use Graph > Scatterplot > With Connect Line and entering on the first three lines of the Y Variables and X variables lines: Population Year, LowEst Year, HiEst Year. Then click on Multiple Graphs and choose Overlaid in the same graph.

Then make some edits on the resulting graph:

— Change the Y axis label to something nice like “World Population (Millions)”
— Remove the connect lines for LowEst * Year and HiEst * Year
— Change the plot symbol for the LowEst * Year and HiEst * Year lines to be plus signs (+)

Now you have a graph with a connected line showing the population and plus signs above and below the line representing the range of the estimate.

You could create stock market type graph with the hi/lo line for each point but it is ugly:

— Use Calc > Calculator and create a new Variable called “Row” using the Expression “pars(Year-9999999)”. This creates a column which has the row number as the value.

— Use Data > Transpose Columns and enter “Year Year” in the “Transpose the following columns” and in the “Create variable names using column” box enter “Row”.

— Use Data > Transpose Columns and enter “LowEst HiEst” in the “Transpose the following columns” and in the “Create variable names using column” box enter “Row”.

— Create a simple scatterplot of Population * Year.

— Capture the command language code via Editor > Copy Command Language

— Paste the lines of code into notepad

— Change the last line of code from “NoDTitle.” to “NoDTitle;”

— Add in the following lines of code (not including dashes) (assuming you have 6 rows of data):
—– Line ‘1’ ‘1_1’;
—– Line ‘2’ ‘2_1’;
—– Line ‘3’ ‘3_1’;
—– Line ‘4’ ‘4_1’;
—– Line ‘5’ ‘5_1’;
—– Line ‘6’ ‘6_1’.
— Paste all the lines into a command line window in Minitab (Ctrl/L) and execute.

I haven’t gone through the explanation of what you are doing but if you follow along, it should become apparent. Post a reply if you’d like more of an explanation.

Good Luck.

42. Hi,
I have one graph showing one variable. I want to have this graph in a way that shows two scales for Y axis. Thank you.

• From your question I assume you have a column with values that you would like to express vs 2 scales of measure such as Degrees F or Degrees C.

Here are the steps I would take:

1. Create a new column using Calc > Calculator with the values in the alternate unit of measure. eg. if you had a column named ‘Degrees C’, I’d use Calc > Calculator and create a new column ‘Degrees F’ by entering

1.8*’Temperature (C)’+32

in the Expression Box.

2. Create your graph e.g. Graph > Scatterplot > With Connect Line. In row 1 of the Y Variables and X Variables table enter say ‘Degrees F’ and your X variable. In row 2 enter ‘Degrees C’ and the same X variable. Then click on the Multiple Graphs Button and choose the option “Overlaid on the same graph” on the “Multiple Variables” tab. Click OK, OK to generate the graph.
3. Edit the Y axis Scale by double clicking on it. In the Edit Scale dialogue click on the “Secondary” tab. Make one of the variables Secondary.
4. Edit the Primary and Secondary Y axis scales so that they have a range that exactly corresponds so that the 2 lines will overlap. For instance in our example the ‘Degrees F’ axis could have the Scale Range Minimum set to 32 and the Maximum to 212. The ‘Degrees C’ axis would then be set with min/max of 0 and 100.
5. Get rid of the unneccessary Legend. It can also be helpful to add gridlines to the graph.

I hope this is what you were trying to achieve.

Cheers – Mark

43. hi, I am working in a project in my job, so i need to find the distribution for a non normal data with using Stat > Quality Tools > Individual Distribution Identification to determine the best distribution and to get the p-value and after make the graph with an specific distribution, but I want to improve this way to do it and i need something to help me to take the data and give me the correct graph instead of been selecting the best fit closing each box that minitab gave ….
am trying to make a macro but, I’m just using data from “history” in minitab .

• I’m not quite sure what you are after…

Stat > Quality Tools > Individual Distribution Identification

does give you many distributions to evaluate. The “best” distribution is a judgement. The p-Value is a good guide to let you know that the distribution in question is a bad fit – i.e. if the p-Value is low. That does not mean that the distribution with the highest p-Value is the best fit however. You can use the graphs to look at where the fit for a given distribution is good, if there might be outliers, etc.

I don’t know if this helps – Cheers – Mark

44. hi again, i had a problem with a macro and apear this ERROR:

* ERROR * Not enough work space for macro processor. Increase worksheet
* size or erase unnecessary variables.
and I don’t know what to do ’cause I’m working with so many variables, actually i want to program 50 characteristics with 14 possibilities so the user just can choose one between 1-14, here is an example:

########### 1St characteristic ##########
IF C26(1)<=0.05

NormTest ' 1 st characteristic'; #Normality test

GSAVE " folder name ";
REPLACE;
JPEG.

ENDIF

IF C26(1)<=0.05
DCapa '1 st characteristic'5;
All;
BoxCox;
Johnson 0.10;
RDescriptive;
RFitTests;
REstimate.

ENDIF

IF C26(1)<=0.05

BRIEF 2
NOTE
NOTE
NOTE write a code between 1-14

SET C60;

FILE "TERMINAL";

NOBS 1.

COPY C60 K1.

IF K1=1

NNCapa '1 st characteristic'5;
Exponential;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE " folder name";
REPLACE;
JPEG.

NNSixpack '1 st characteristic'5;
Exponential;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "folder name";
REPLACE;
JPEG.

ENDIF

IF K1=2

NNCapa '1 st characteristic';
TExponential;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "folder name ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic'5;
TExponential;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;
GSAVE "folder name ";
REPLACE;
JPEG.

ENDIF

IF K1=3

NNCapa '1 st characteristic'5;
LNormal;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "folder name ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
LNormal;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "Folder name";
REPLACE;
JPEG.

ENDIF

IF K1=4

NNCapa '1 st characteristic;
TLNormal;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "Folder name";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
TLNormal;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "folder name ";
REPLACE;
JPEG.
ENDIF

IF K1=5

NNCapa '1 st characteristic';
Weibull;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
Weibull;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.
ENDIF

IF K1=6

NNCapa '1 st characteristic';
TWeibull;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
TWeibull;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.
ENDIF

IF K1=7

NNCapa '1 st characteristic';
SExtremeValue;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
SExtremeValue;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.
ENDIF

IF K1=8

NNCapa '1 st characteristic';
LExtremeValue;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
LExtremeValue;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.
ENDIF

IF K1=9

NNCapa '1 st characteristic';
Gamma;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
Gamma;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.
ENDIF

IF K1=10

NNCapa '1 st characteristic';
TGamma;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
TGamma;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.
ENDIF

IF K1=11
NNCapa '1 st characteristic';
Logistic;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "foldername";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
Logistic;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.
ENDIF

IF K1=12
NNCapa '1 st characteristic';
LLogistic;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
LLogistic;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.
ENDIF

IF K1=13
NNCapa '1 st characteristic';
TLLogistic;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic' 5;
TLLogistic;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "foldername";
REPLACE;
JPEG.
ENDIF

IF K1=14

Capa '1 st characteristic' 5;
Lspec 3.5;
Uspec 4;
Johnson;
PValue 0.10;
OBiased;
Toler 6;
CStat;

GSAVE "foldername ";
REPLACE;
JPEG.

Sixpack '1 st characteristic' 5;
Lspec 3.5;
Uspec 4;
Johnson;
PValue 0.10;
OBiased;
Breakout 25;
Toler 6;
CStat;
Test 1;

GSAVE "foldername ";
REPLACE;
JPEG.
ENDIF

ENDIF

########### 2nd characteristic ##########
IF C26(2)<=0.05

NormTest ' 2nd characteristic'; #Normality test

GSAVE " folder name ";
REPLACE;
JPEG.

ENDIF

IF C26(1)<=0.05
DCapa '2nd characteristic'5;
All;
BoxCox;
Johnson 0.10;
RDescriptive;
RFitTests;
REstimate.

ENDIF

IF C26(1)<=0.05

BRIEF 2
NOTE
NOTE
NOTE write a code between 1-14

SET C61;

FILE "TERMINAL";

NOBS 1.

COPY C61 K2.

IF K2=1

NNCapa '1 st characteristic'5;
Exponential;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE " folder name";
REPLACE;
JPEG.

NNSixpack '1 st characteristic'5;
Exponential;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;

GSAVE "folder name";
REPLACE;
JPEG.

ENDIF

IF K2=2

NNCapa '1 st characteristic';
TExponential;
Lspec 3.5;
Uspec 4;
Toler 6;
CStat;

GSAVE "folder name ";
REPLACE;
JPEG.

NNSixpack '1 st characteristic'5;
TExponential;
Lspec 3.5;
Uspec 4;
Breakout 25;
Toler 6;
CStat;
GSAVE "folder name ";
REPLACE;
JPEG.

ENDIF
.
.
.
.
.
. etc.
etc.

• Running out of resources is something I’ve run into. I usually split the job into several macros (as separate files) with one overall macro calling the sub-macros. Another technique is to put repetitive code into a sub-macro within the file of the calling macro. That can reduce the line count of the code.

Another thing I do along the way is close graphs which have already been saved to disk so that Minitab is using less memory – although I don’t think that would solve things here. This is the code:

# Use an undocumented command to close all graphs. Saves time on exit.

GMAN;
CLOSE;
NOPrompt;
All.

Good Luck – Mark

45. I am new to Minitab software and have the free trial version (Minitab 17) downloaded. I created a worksheet (columns of date, pass, and fail) but received an error message of ” Graph cannot be created because there are no valid data.” when I tried to generate Xbar-S chart. The observation is Pass and my subgroup size is Date. Thanks!

• Do you have multiple entries of the same date? For it to be a sub-grouping variable it needs to have repeated observations.

eg.

Date Pass
1/01/14 -0.88467
1/01/14 0.89292
1/01/14 -0.04537
1/01/14 0.41590
1/01/14 -1.13085
1/01/14 -1.53445
1/01/14 0.19576
1/02/14 -0.98216
1/02/14 0.06389
1/02/14 0.08080
1/02/14 -0.15770
1/02/14 -0.19769
1/02/14 -1.03806
1/02/14 0.77784
1/03/14 -0.91421
etc.

46. I have multiple charts where I need to change the symbol style and color to identify certain groupings – is there any quick way to repeat the symbol change like duplicate last command – similar to f4 in Excel?

• Yes but with a little work.

Once you have your graph with the modifications you want, click on the graph to give it focus and then click on Editor > Copy command language.

This puts the commands which generated the graph into the clipboard. If your next graph is the same type of graph with just different variables or time ranges you could open the command window via Ctrl/L, paste the commands make changes to the variable names and resubmit them. If you are changing graph types, you might need to capture the commands for the first graph, paste them in notepad do the same for the second graph, copy the symbol and color commands from the first, replace the corresponding lines in the second graph, copy the modified commands for the second graph and paste them in the Ctrl/L window and submit.

Other posts on this site show similar manipulations.

I am on the road reying from my phone so I hope the reply is not garbled.

47. I recently started using the API in to have VBA speak with Minitab in order to automate report generation from pulling data to outputting data. In fact, I am staying very close to the code shown at this website: http://blog.minitab.com/blog/customized-data-analysis/creating-a-custom-report-using-minitab-part-1.

The difference that I have added in, that I think is substantive, is I subset my data to continue to create meaningful charts. The constants are stored in this second worksheet, so my code throws an error when I try to “GetData”.

Does anyone know how I could specify which worksheet to go to to grab the value stored in constant 1 or 2?

Thanks!

• Sorry for the delay – my vacation however was wonderful!

I used the API when it first came out and it looked quite powerful. However, most of my experience is with simple Minitab macro code. I have had the concept of “universal constants” i.e. not tied to a specific worksheet on my Minitab wish list for many years. Still waiting!

The code

Worksheet “MyData”

would make the worksheet “MyData” the active worksheet and so the any constants referred to would be for that worksheet.

Notes:

1) You can bring constants into a subsetted worksheet with the

Constants;

sub command.

2) If you are creating a new worksheet by say sorting selected columns into the new worksheet you will lose constants. If you need to bring the value of a constant into the worksheet you can do it with this workaround:

a) create a column in the starting worksheet with the value of the constant. It does not work to say

Let c10[1] = k3

because when the worksheet is sorted all columns must be equal length. Instead use code like assuming column MyVal has text values:

Name c10 “ConstantCol”

This will put the value of the constant in each row of the worksheet.

b) Do your sort into a new worksheet.

c) Extract the value from the column into a constant. eg.

Let k3 = ‘ConstantCol'[1]

d) Optionally, delete the column ‘ConstantCol’.

48. Hello,

Thanks for all the help. Love your site.

I am having an issue with scaling graphs. When I run the following, every graph’s scale range is set to AUTO, but defaults to the max from the total data set. Any way this? Thanks in advance

Chart SUM(COUNT) * ‘XYZ_123’;
Scale 1;
HDisplay 0 0 0 0;
Scale 2;
HDisplay 1 1 0 0;
MODEL 1;
Min 0;
EndMODEL;
Separate ‘ABC’; #—-Can’t get these to scale
NoMiss;
NoEmpty;
Decreasing;
Graph 12 4;
Bar;
Title;
SubTitle;
StSep;
Footnote;
FPer;
Footnote;
FPanel;
NoDTitle;
NoSepSubtitle;
NoPerFootnote.

• Sorry for the delay. My vacation was wonderful!

One approach which involves macro code:

Put the chart inside a loop and then instead of the

Separate ‘ABC’;

subcommand use an Include command like:

INCLUDE;
WHERE “ABC’=k5”;

where k5 has been defined as the value of ‘ABC’ of interest for this graph. Here is a worked example using Natural Gas usage for my house:

# SeparateCharts.mac – Macro to split charts so scaling is appropriate
#
# M.A. Sibley Consulting, Kingston, Ontario. Copyright 2015
#
# 2015-07-23 MAS – New Macro

gmacro
SeparateCharts

# Create a table with a listing of the insulation grades

Statistics ‘MetersCubed’;
By ‘InsulationStatus’;
N ‘NoMths’.

Let k10 = count (‘InsulationGrade’) # Number of Insulation Grades – used in DO loop

DO k11 = 1 : k10

# Define constant for subsetting

Let k5 = ‘InsulationGrade'[k11] # access value in ‘k11’th row

# Define text string for storing graph as a JPEG file

Let k3 = concatenate(“C:\MTB\Output\Insulation_”,k5,”.jpg”)

# Define a descriptive title

Let k4 = concatenate(“Mean(Meters Cubed) for Insulation Status of “,k5)

Chart MEAN(MetersCubed) * Month;
# Separate InsulationStatus; # no longer used
Include;
Where “‘InsulationStatus’ = k5”;
Bar;
Title k4;
SubTitle;
StSep;
Footnote;
FPanel;
NoDTitle;
NoSepSubtitle;
NoSFootnote;
NoXFootnote;
gsave k3;
replace;
jpeg.

ENDDO

endmacro

49. Hi,

Anyone could tell me how to install the NADA macro in the already installed Minitab16?

Thank you!
Chhavi

50. Hi,

Im trying to make a histogram but recieve this error:

“A graph cannot have more than 400 panels” What does that really mean and how can I solve the issue without removing any data?

51. Name C45 ‘Matched_Clean’
Let ‘Matched_Clean’ = IF(‘Matched’ < 'Source_Count', 'Matched','*')

Name C48 'Delta_Clean'
Let 'Delta_Clean' = IF('Delta_Count' < 'Source_Count', 'Delta_Count','*')

Name C50 'Spanned_Records_Clean'
Let 'Spanned_Records_Clean' = IF('Spanned_Records' < 'Reformat_Input', 'Spanned_Records','*')

Name C51 'Total_Imputed_Clean'
Let 'Total_Imputed_Clean' = IF('Total_Imputed' < 'Reformat_Input', 'Total_Imputed','*')

Name C52 'Accepted_Clean'
Let 'Accepted_Clean' = IF('Accepted' < 'Initial_Staging_Load', 'Accepted','*')

Name C53 'Rejected_Clean'
Let 'Rejected_Clean' = IF('Rejected' < 'Initial_Staging_Load', 'Rejected','*')

Name C55 'Updated_from_Batch_Clean'
Let 'Updated_from_Batch_Clean' = IF('Updated_from_Batch' < 'Delta_Count', 'Updated_from_Batch','*')

Name C56 'Deleted_from_Batch_Clean'
Let 'Deleted_from_Batch_Clean' = IF('Deleted_from_Batch' < 'Delta_Count', 'Deleted_from_Batch','*')

Name C57 'New_Actives_Clean'
Let 'New_Actives_Clean' = IF('New_Actives' < 'Accepted', 'New_Actives','*')

Name C58 'New_Terms_Clean'
Let 'New_Terms_Clean' = IF('New_Terms' < 'Accepted', 'New_Terms','*')

Name C59 'Net_New_Records_Clean'
Let 'Net_New_Records_Clean' = IF('Net_New_Records' 5 data points and TS plots < 5?

Subset;
Where "'BARR_ACRONYM' = ""ACH""";
Name "ACH";
NoMatrices;
NoConstants;
Include.

PPrimeChart 'Matched_Clean' 'Source_Count';
Stamp 'DATE';
Title "Match/Source_Count % SPC CHART";
SubTitle "ACH".
Stamp 'DATE';
Title "Updated/Delta_Count % SPC CHART";
SubTitle "ACH".
Stamp 'DATE';
SubTitle "ACH".

• Is there a way I can loop through barr acronyms? And where it is greater than 5 datapoints create all those pprime charts and if less than 5 create ts plots?

52. Dear Kevin,

Thanks for looking at my query and I sincerely hope you find a suitable solution for the same.
This is a query regarding Modifying the Y-axis data label for percent scale in histogram in Minitab.
Formatting of column only fix the decimal for the data displaying in the column. That works on my app but even when we fix it to zero decimal, the percent data label of Y-axis has multiple decimals, is this the case normal!

What I was searching is, the percent data label shows in 5-6 decimal which is actually not visually required for external person as they would like to see broad % distribution, may be one decimal is enough. When there are many bins, then so many decimal which congest the graph. I hope you understand my concern.

regards,
M J

53. I have many graghs. Im trying to make a legend but i can not do it !!!!

• Sorry, I need more information. What types of graphs are you having trouble generating an legend for? For instance, a Scatterplot with groups will have a legend by default. Are you trying to generate an index of already generated graphs??

Mark

54. I’m trying to follow your procedure “Add Arrows to Graphs”. However, I am using local macros, as I have to declare some variables. Can I pass declared variables to a called macro? I’m creating a plot like this:
PLOT A*Z B*Z C*Z
where A, B, C and Z are variables. My basic structure is like this:
MACRO
TEST A B C Z Kone Ktwo
MCOLUMN A B C Z
MCONSTANT Kone Ktwo KX KCnt
LET KX = 2
LAYOUT
DO KCnt=1:KX
Call MyGraph A B C Z
ENDDO
ENDLAYOUT
ENDMACRO

The MyGraph macro is:
MACRO
MyGraph A B C Z
MCOLUMN A B C Z
PLOT A*Z B*Z C*Z
ENDMACRO

It’s actually more complicated. I have data that can have a variable number of columns that I want to plot. When I plot the data I use paneling in my PLOT command. The number of panels can vary from data set to data set. I’m adding text to each panel. The only way I can do this is via a do loop. PLOT won’t allow a do loop within the subcommands. It seems like your solution to the “Add Arrows” should work, but I can’t figure out how to pass the variables from one macro to another.

Thanks!

Bruce

• Sorry for the delay in replying. Life, work, etc.

I’ve tended to avoid Local Macros as they are harder to work with as you cannot see what you are doing as you go and you cannot mix Global and Local macros.

If you keep all you macros as global macros (GMacro) can you not, before you call the Macro test simply copy the variables of interest eg.

If your variables in the calling routine are AOriginal, BOriginal, COriginal, ZOriginal then you could do something like the following:

Let A = AOriginal
Let B = BOriginal
Let C = COriginal
Let Z = ZOriginal
Call Test

It means 5 lines of code instead of 1 but will this work for you?

Good Luck.

55. Hello

I come with two questions and I will be glad if you help me.
1) My Minitab is a German version and therefore, the decimal separator is “,” instead of “.” . How can I modify this?

2) I have moved my legend box to the bottom of the diagram which has 5 labels. I want to rearrange the labels in a way that I could see the labels in two columns and 3 rows instead of on column which is the default layout. This method is very easy in Excel but I cannot do the same with Minitab.

Kind regards and thanks in advance
Hamed

• I’m catching up on some old posts. I thought I had replied to this one!

re: 1) Here is a link on how to change the decimal separator:

http://support.minitab.com/en-us/minitab/17/topic-library/minitab-environment/interface/customize-the-minitab-interface/change-the-decimal-separator/

re: 2) Minitab has no provision for flexible legend layouts. Pity. I’d like to see the option for a one row legend at the bottom of a graph.

Here is a work around I’ve used:

You can create your own legend if the assignment of plot symbols is not dynamic – i.e. if you always have the 5 same plot symbols referencing the same values then you can use the techniques outlined in this web site under How To > Custom Symbols but instead of putting the symbols into the graph, you can create a footnote with the symbols. In fact you can add one footnote for each symbol and change the font colour to match the graph. If you change the alignment (position) of the footnote, you can have them all on one line (or 2 or whatever).

56. Dear friend,
Iam trying to estimate parameters in my custom function. The function is dynamic and to estimate a trend (my model), the function need to read a value from another column but the value is no in the same row. In excel is easy but I want to try the power of minitab to estimate parameters and confidence intervals.

• The macro code I have posted under How To > Multi-Capability shows how to store the output of statistical procedures and then read them back as values from a specific row. For instance this line stores the value in the first row of column ‘CMean’ in the k81st row of the column ‘Mean’. So if k81 is 12, the value of the mean would be stored in the 12th row of column ‘Mean’.

Let ‘Mean'[k81] = ‘CMean'[1]

The macro is complex, but demonstrates many capabilities of Minitab’s creaky old (and effective) macro language.

If this doesn’t provide what you need, perhaps you could be a little more specific.

57. Hello,
I have the following macro which lays a bar graph over a control chart graph. I’m getting by default different max Y values. I need to have the bar graph to use the same max value of the control chart graph. How can I can implement this in my macro below?

IChart ‘SumOfSumOfTotalEquivs’;
Stamp ‘YearMonth’;
Title “WW data”;
Scale 1;
Angle 90;
Data;
Estimate 12 : 23;
Slimits 1 3;
Test 1 2 3 4 5 6 7 8;
DefTest 1 2.0 4 12 7 12 8 6.
Chart ( ‘Shipments’ ‘Backlog’ ) * ‘YearMonth’;
Scale 1;
TIncrement 3;
LDisplay 0 0 0 0;
HDisplay 0 0 0 0;
Scale 2;
LDisplay 0 0 0 0;
HDisplay 0 0 0 0;
AxLabel 2;
Overlay;
VLast;
TShow 1 2;
Summarized;
Stack 1;
Data 0.2900 0.7188 0.2791 0.8827;
Type 0;
Legend 0.8669 0.9884 0.0573 0.1632;
Section 1;
NoDTitle;
Bar.

ENDLAYOUT.

ENDMACRO

58. Mark , did you know how to get on a table the P-values for a Run Chart , I would like to see this in that way when I run more than 20 or 30 runcharts at the same time for many variables.?

• I know this is an old post, but I finally dug in a little. All I can find in Minitab documentation vs the algorithms it uses for generating the p-values on a run chart are generalities. I was hoping each test would have a single test capable of “storage” in which case, I could answer the second part of your question. I’ve used macro code to run the same test/algorithm on many columns of data generating a table so if you figure how to get your p-values, let me know and I’ll post the technique for the second half of your question.

Minitab does references 3 sources for the basis of run-chart p-values. They are:

[1] J.D. Gibbons (1986). “Randomness, Tests of,” Encyclopedia of Statistical Sciences, 7, 555-562.

[2] T.P. Ryan (1989). Statistical Methods for Quality Improvement. John Wiley & Sons.

[3] W.A. Taylor (1991). Optimization & Variation Reduction in Quality. McGraw-Hill, Inc.

Good Luck – Mark

• Hi Mark

Thanks always for your support , I did somme investigation and using excel I may have a way to do it.

Expected number of runs
Expected number of runs above and below the median = 1 + ((2 * m * n) / N)

where:

m = number of points > center line

n = number of points center line

n = number of points < = center line

After this I found that in Minitab there is a place for calculate this Pvalues for the 4 different ways of clustering , mixtures trends or oscillations.

I can do on excel but is a pity that I'm missing something that when compare the calculation on excel to Minitab there are somme diferences.

Maybe I need more time to see where is the fault on the calculation.

Juan Antonio

59. sir,

I want to optimize the composition of three materials in box-behnken in minitab but after giving the range from 0-100% the optimized run gives more than 100%

• If you are doing a composition DOE, would you not be better off using a mixture design? I have limited experience in this area.

For your optimization DOE, is the difference from 100% statistically significant?

60. Sir can any one tell me how to make overlay plot of contours

• Since you didn’t provide details, I assumed you wanted to overlay 2 Z variables (say Yield for lot 1 and Yield for lot 2) against common X and Y variables.

I used one of the Minitab 17 example datasets and here is how I did it.

Notes: I have the command prompt enabled, and I used the techniques shown elsewhere to capture the command language for a modified graph.

1) I opened the Reaction_Model worksheet from the Minitab sample datasets.
2) Using Calc > Calculator, I created a second similarily ranged Yield variable called Yield2. (See the forumla below).
3) I used Graph > Contour Plot, selected “Contour Lines” instead of “Area” under Data View. I entered Yield as the Z variable, Temp as the Y variable, and Time as the X variable.
4) I right clicked on the contour lines and selected Edit Contour Lines and then customized the contour lines so they had “varying attributes”.
5) I changed the title to “Contour Plot of Yield vs Temp, Time (Red = Yield, Green = Yield 2)”.
6) I changed the data area to be slightly different in size. This has effect of putting the coordinates for the data area into the commands that you will eventually save.
7) I again right clicked on the contour lines and selected Custom Attributes and proceeded to edit the colour of all the lines to be red, and the size of the lines to go from 1 for the first contour line to 7 for the 7th contour line.
8) I then captured the code for the graph. (With the graph having focus, Editor > Copy Command Language).
9) I then put the code into a plain text editor (e.g. Notepad), and added:
… a) the Layout command at the top
… b) the pasted code for the contour plot
… c) the code again to get a second plot
… d) the EndLayout command
10) I then changed the code for the second contour plot:
… a) I added Type 0; after the Data command so that the second graph would have a transparent background, otherwise you would not see the first graph when they are overlaid.
… b) I changed the colour for the contour lines to 3 (Green) in the color subcommand.
… c) I changed Yield to Yield2
11) I then copied all the commands into the clipboard, pressed Ctrl/L within Minitab to bring up the Command Line Editor window, pasted the commands (Ctrl V) and then pressed the “Submit Commands” button.

Viola! As easy as 1, 2, 3, more, more…..!!

Here are all the commands including the initial file open, etc.:

WOpen “C:\Program Files (x86)\Minitab\Minitab 17\English\Sample Data\Reaction_model.MTW”.

Name C8 ‘Yield2’
Let ‘Yield2’ = ‘Yield’*.8 + 12 +0.12*’Time’

layout

Contour Yield * Temp * Time;
AxLabel 1;
TColor 1;
Offset -0.0268353174603175 &
-0.0123511904761905;
AxLabel 2;
TColor 1;
Offset -0.00982142857142857 &
-0.0108630952380953;
NoArea;
Distance;
Power 2;
Data 0.1373 0.8373 0.1405 0.8798;
Legend 0.8603 0.9794 0.581 0.8798;
Section 1;
Connect;
Type 1 2 3 4 5 1 2;
Color 2 2 2 2 2 2 2;
Size 1 2 3 4 5 6 7;
AttSet 2;
Title &
“Contour Plot of Yield vs Temp, Time (Red = Yield, Green = Yield 2)”;
Footnote;
FPanel;
NoDTitle.

Contour Yield2 * Temp * Time;
AxLabel 1;
TColor 1;
Offset -0.0268353174603175 &
-0.0123511904761905;
AxLabel 2;
TColor 1;
Offset -0.00982142857142857 &
-0.0108630952380953;
NoArea;
Distance;
Power 2;
Data 0.1373 0.8373 0.1405 0.8798;
Type 0;
Legend 0.8603 0.9794 0.1405 0.44;
Section 1;
Connect;
Type 1 2 3 4 5 1 2;
Color 3;
Size 1 2 3 4 5 6 7;
AttSet 2;
Title &
“Contour Plot of Yield vs Temp, Time (Red = Yield, Green = Yield 2)”;
Footnote;
FPanel;
NoDTitle.
endlayout

61. Hi,
Does any of you used minitab for mixture design before?
I used it for a 4-component miture design. I wonder how they calculated the coefficient value for each component and 2-way and 3-way interactions. Also I don’t quite understand only interactions have P-value, but single factors don’t have.
I check Minitab guidebook, but I didn’t find any answer for that.

A typical result sheet look like this:
Estimated Regression Coefficients for Carvedilol (component proportions)

Term Coef SE Coef T P VIF
MG 0.099 0.2189 * * 3.629
BS 0.060 0.2189 * * 3.629
PL 0.137 0.2189 * * 3.629
OA 2.073 0.2189 * * 3.629
MG*BS 0.781 1.0479 0.74 0.459 3.480
MG*PL 2.177 1.0479 2.08 0.042 3.480
MG*OA -4.172 1.0479 -3.98 0.000 3.480
BS*PL 2.175 1.0479 2.08 0.042 3.480
BS*OA -1.947 1.0479 -1.86 0.068 3.480
PL*OA -0.829 1.0479 -0.79 0.432 3.480
MG*BS*PL 5.758 6.3171 0.91 0.365 1.993
MG*BS*OA 1.852 6.3171 0.29 0.770 1.993
MG*PL*OA -1.209 6.3171 -0.19 0.849 1.993
BS*PL*OA 9.283 6.3171 1.47 0.147 1.993

S = 0.372419 PRESS = 13.2739
R-Sq = 61.46% R-Sq(pred) = 42.37% R-Sq(adj) = 53.64%

• Having only interactions as significant is not the usual case but it does happen. Think synergistic or antagonistic. Trivial example – think of a propane and air as the 2 components in your mixture and temperature rise as the response after being exposed to a spark. Either component alone – no temperature rise after exposure to the spark. With the “right” proportions – big temperature rise!

I am no expert in mixture design so if someone else would like to chime in – please do!

• Thank you rk.s:) I quite understand the fact that it could happen that only interactions are significant but not single factors. What I don’t understand is why the single factors don’t even have a p-value provided (see above all the p-value for single factors are just *, so no data in minitab)? So that makes me thinking about how they even calculate the coefficient number.

62. Hi,

This website has really helped me making an ‘Auto Job’ of a bunch of control charts that need updating. I have 2 questions though:

1) I have to query a data base, which works just fine, but I want to have the macro save the file and then when it runs later, to wipe out the columns and then put the new data there. I read on a combination of Minitab, here, and google searches that I can do this with a macro and the COLUMNS command, but I struggle making it work. I think it has something to do with the fact that I have multiple lines of code, but I’m not sure. Here is my code:

GMACRO
DBQUERYPHASE

WORKSHEET “By Phase”.
ODBC;
Connect “DSN=Excel Files;DBQ=Z:\Human Splitting Activity.xlsm;DefaultDir=Z:” &
“;DriverId=1046;MaxBufferSize=2048;PageTimeout=5;”;
SQLString “SELECT `Parent Lot Number`,`Min Result Date`,`Spec Name`,`Recipe” &
” No`,`Sub Family`,`Organization Code`,`Batch No`,`Target Thickness`,`Targe” &
“t Thickness for Attribute Lookup`,`SPLITTER_EQ`,`OffsetCalc`,`ThckNomTop`,” &
“`XckNomTop`,`Number-Pcs-Thck`,`Number-Pcs-Thn`,`Number-Pcs-Xck`,`Number-Pc” &
“s-Med`,`Team`,`Prod_Family`,`Shift` FROM `Z:\Human Splitting Activity.xlsm” &
“`.`’By Splitting Phase\$’`”.
COLUMNS `Parent Lot Number` `Min Result Date` `Spec Name` `Recipe No` &
`Sub Family` `Organization Code` `Batch No` `Target Thickness’&
`Target Thickness for Attribute Lookup` `SPLITTER_EQ` `OffsetCalc`&
`ThckNomTop` `XckNomTop` `Number-Pcs-Thck` `Number-Pcs-Thn`&
`Number-Pcs-Xck` `Number-Pcs-Med` `Team“Prod_Family` `Shift`.

ENDMACRO

2) My other question is for control charts and creating a stage gate. I know how to hard code these values in but becasue I’m only working with a certain time frame, dates can cause the code to stop running when they are no longer part of the dataset. Is there a way to run through a date range, see if it is in the dataset, then use that date, if not move on? I can’t seem to find a good way to make the code ‘move on’ from errors. Here is the code I’m working with:
XbarChart ‘OffsetCalc’ ‘Min Result Date’;
Stamp ‘Min Result Date’;
Title “X-bar Chart for Offset”;
SubTitle “Splitter 2392”;
Include;
Where &
“‘SPLITTER_EQ’ =””2392″” And ‘Min Result Date’ > TODAY() – ELAPSED(30)”;
HProcess ‘Min Result Date’;
Values “2/24/16” “3/6/2016” “3/13/2016”.

63. Savannah,

If you check in this website under “How To > Control Chart with Dynamic Stages” I think I’ve answered your question 2) and more. Some people use Crosswords for mental stimulation. I like a good programming challenge!

re: 1) You have ended your ODBC command with a period and then started a new command “Columns”. The Columns command should be a sub-command of the ODBC command which would happen if the line above the column command ended with a semi-colon instead of a period – i.e. Instead of:

“`.`’By Splitting Phase\$’`”.
COLUMNS `Parent Lot Number` `Min Result Date` `Spec Name` `Recipe No` &

You should have:

“`.`’By Splitting Phase\$’`”;
COLUMNS `Parent Lot Number` `Min Result Date` `Spec Name` `Recipe No` &

• Yes! That completely answers the second part of my issue.
The columns command though still refuses to work even with the proper semi colon/ period placement. Could there be a difference in calling a local vs global macro vs an exec? I’m using a global macro here but should I use something else? I never was totally sure which one was the most appropriate

• I’m not sure what your problem is. In most of my jobs I start with new worksheets, read in the data via ODBC and carry on from there. I did try using the columns command to over-write the existing data in columns with new data from the database. I do almost all my macro work via Global macros as they are easier to work with. This code worked for my example:

# Get data via ODBC (in this case an example excel file)

ODBC;
Connect “DSN=Excel Files;” &
“DBQ=C:\Users\marka\OneDrive\Documents\MASibley Consulting\” &
“Web Site\Control chart stages\MyControlChartData.xlsx;” &
“DefaultDir=C:\Users\marka\OneDrive\Documents\MASibley Consulting\” &
“Web Site\Control chart stages;” &
“DriverId=1046;MaxBufferSize=2048;PageTimeout=5;”;
SQLString “SELECT `MyDate`,`MyVar` FROM `Sheet1\$`”;
Columns ‘MyDate’ ‘MyVar’.

I’m not sure what is going wrong for you.

64. How in Minitab can I use only the last 125 results for Individual control charts and for Capability Analysis > Normal.
In the Individuals Chart: Options there is a “Display” tab that has “Subgroups to display” > Last: “125”

But for the Capability Analysis there is no such thing. I guess I have to manipulate the data in the spreadsheet to copy the last 125 results to a new column and use this column to create my charts.
Data > Copy > Columns to Columns > Subset the Data… I can write a conditon for “Rows that match” but need help to do it.

What do I have to write as a condition to get the last 125 values copied to a new column?

• Let’s say your variable is named MyVar. You can achieve your result with these steps:

1. Create a new variable that is essentially the row number. In Calc > Calculator I put ‘Row’ in the Store result in variable: box. In the Expression box I enter pars(‘MyVar’<>9999999) and then press OK. The 9999999 is any number that will not be a value of ‘MyVar’ that might be encountered. This means the partial sum is summing an expression — ‘MyVar’<>9999999 — that always returns a 1 (true). The partial sum adds this new value for the row the previous value of the sum from the previous row. The net effect is a variable that is 1 in row 1 and 100 in row 100, etc.
2. I use Calc > Calculator again and this time I create a variable ‘MyVarLast125’ and use the expression if(max(row)-row<124.5,'MyVar','*'). This creates a new column with all but the last 125 values of the variable set to missing. You can then do your capability analysis on this variable.

If you don’t like creating extra columns and don’t mind erasing the initial rows of your variable you could use an expression like:

Let ‘MyVar’ = if(max(pars(‘MyVar’<>999999999))-pars(‘MyVar’<>999999999)<124.5,'MyVar','*')

Cheers – Mark

65. Hello,

Any way to have a macro trigger an email being sent with a graph from outlook?

I love the site, thanks so much!

• Minitab has VBA capability that I’ve used sparingly so likely you can do what you want – however I’ve used the capability only sparingly and not do to e-mails. Minitab as a company often do custom jobs that do exactly what you are asking for. I’d suggest you direct your inquiry to them.

66. Hi,
I am creating contour plots of the response of my DOE and I have a question about how Minitab forms these plots. Some of my design points are replicates – does Minitab take the average response for the replicates then plot that? I seem to be always getting “concentrated” response around the centre point of my DOE where there are numerous replicates and I wasn’t sure if this was a true result or an artifact of Minitab’s contour plotting. Thank you

67. Hi, I am creating capabilities six pack charts using a global macro. My code snippet is shown below:
Sixpack ‘Left’ 1;
Lspec 2.500000e+00;
Uspec 2.530000e+00;
Pooled;
AMR;
CCRbar;
CCSbar;
CCAMR;
UnBiased;
OBiased;
Breakout 25;
Toler 6;
CStat;
Test 1;
GSAVE “C:\Temp\Left”;
JPEG.

It works great to make and save the plot. However, the scale of the x-axis is just the default “index”. These observations are actually made against known part number which is just another column in my worksheet. To have the Individual Values and Moving Ranges charts reflect the part number on the x-axis, I can manually:
on the graph right click->
Edit X-Scale->
Time->Stamp->Select part number column
Is there a way to capture this and execute in the global macro?

• Alas, no. With the Graph> xxxx commands you can capture virtually any command related to your manual refinements of the graph. With graphs on the Stat > xxxx menu you get only selected sub-commands. The good news is you can interactively customize the graph further as you have done but you cannot use a command like

Editor > Copy Command Language

like you can with the Graph > xxxx graphs to capture these changes.

If you go under Help > Help > Session Commands (on left side of right panel) > click the Search Tab and search for Sixpack you can see all the possible sub-commands – but unfortunately, STAMP is not one of them.

I’d put in a “wish list” request to Minitab.

68. Hi, i am creating a process capability chart and need to include refrence line in the chart. My code snippet is shown below:

Capa ‘FIPG Width’ 1;
Lspec 1.2;
Uspec 0.8;
Reference 2 0.9 1.1;
MODEL 1;
Pooled;
AMR;
UnBiased;
OBiased;
Target 1.5;
Toler 6;
Overall;
Confidence;
TwoCI;
CStat.

i can’t create the refrence line on capability chart.

thank

69. Wouldn’t that be nice to be able to do?

However, as I’ve replied to several other users, Minitab(r) treats graphs generated under the “Graphs >” menu differently from those under other menu items like “Stat >”.

“Graphs > ” graphs can be interactively customized and then under “Editor >” you can use “Copy command language” to put the corresponding session commands into the clipboard. With graphs generated under “Stat >” you can interactively customize the graphs in ways that cannot be reproduced with session sub commands and there is no ability to capture the corresponding sub commands.

Pity. It has been a wish list item.

Look under “Help > Help > Session Commands > Quality Tools > Capa” for the available session sub commands for the Capability analysis.

70. I am trying to display data labels on an Individual Value Plot for only specific data points. In this case, I want to display a data label (value from column Exceptions) only if the value in column Proportions is greater than 0.0007. I tried creating a new column called Labels using the Calculator function and the following formula but it doesn’t work (receive an error message). Suggestions?
IF(‘Proportion’ > 0.0007,’Exceptions’,””)

• Your problem is that you have enclosed “Exceptions” in single quotes. Minitab will then interpret it as a Variable or Constant name.

The specific error I got was:

* ERROR * Undefined label at S (Use double quotes to enclose a text string.)
* ERROR * Completion of computation impossible.

The solution is simple just enclose Exceptions with double quotes and it will be treated as a text string.

– M

71. I have developed a Global macro that creates control charts daily for different parts. However the macro fails in Minitab when there is only one row of data for a particular part. Can you suggest to best way to deal with this, please?

• Nigel,

If you look in the look in the Modules tab and select Module 06, you will see the basic approach you can take the same basic approach to creating a summary table as shown on Page 8 – but this time include the count of non missing (N) for each part. Then, in the DO loop section you can use an IF statement (not to be confused with the calculator IF function), to only create the chart if there is enough data for that part. So let’s say your summary table has the count for each part as the variable “NObs” and we are using constant K11 as the do loop subscript, then you could add an if statement which would only execute the control chart if there are more than 1 observations. It might be like:

IF (‘NObs'[k11] > 1)

Note: just as shown on the graph on Page 15, your control chart would need a INCLUDE statement so that you are generating control charts for a single part each time the DO loop executes,

Good luck – Mark

• Thanks for the input Mark. I’ve (finally) got round to implementing your suggestion above. All works well!

72. Hello,
I am using the Version 17.0 of Minitab. I would like to run it in batch mode, so I created a .bat file that runs Minitab, but I have problems with the execution of the .MTB files:
– I don’t seem to find how to run it via the .bat file
– If I try and Run the .MTB file via ‘File->Run an Exec’ it writes:

Executing from file:’Path\file.MTB’

But doesn’t execute it.

– Even when I try to execute it in the command editor in the Minitab Session via the command:
EXECUTE ‘Path\file.MTB’
it does the same.

The commands inside my .MTB file are correct because when I copy/paste them in the Command Editor it works perfectly.

Thank you

73. It is tricky isn’t it. When I first tried to create a Minitab “Autojob” in 2000, I encountered all sorts of issues the trickiest of which was trying to have the job exit without manual intervention.

If you check out Modules > MTB 05 Minitab Autojobs you will find a full approach to having Minitab execute commands, create graphs, etc. automatically.

The approach I show in the module seems to work about 99% of the time but occasionally a database read times out or a network drive is not available quick enough and the Minitab job stops with an error. If you run these jobs on a dedicated PC, then it is a good idea to monitor it and clean up these failed jobs because eventually enough of them would “bring the computer to its knees”.

I have recently developed a more bulletproof approach which uses .bat file to launch Minitab by creating a unique named copy of Mtb.exe, running it, so that the process name is unique eg. if it were created right now it might be MTB_201609200738455 (where the digits are YYYYMMDDHHMMSSS). I pass a parameter into the batch file job that is a timeout (in seconds) for the job. When that timeout passes, it looks for the process. If it does not find it, it means Minitab exited normally. If it does find it, it means that the Minitab autojob got hung up. In that case it kills the process and writes out a one line file in an error log folder. I then have another batch file that deletes old error log files and concatenates the last 3 days of error log files into one file, and then another Minitab autojob creates reports and graphs of the failed jobs.

This may be more information than you wanted but the framework for running Minitab autojobs lets you do some very cool things!!

74. Hello,

I am trying to create a stacked bar graph (that runs horizontally) on minitab express for mac, but unlike the PC version it is not coming up with a Stacked option when I select bar graph. Are you able to help?

Thankyou

• I don’t have a MAC or Minitab Express so I’m afraid I can’t help you. I suspect that there are differences in the scaled down version of Minitab.

The Minitab help desk is the best of any software I’ve ever used so you might ask them.

75. Hello,
I am an occasional user of minitab (version 17)
I was wondering why in a full factorial DoE without centerpoints it is possible to make contourplots while when centerpoints are available it is not possible to make contourplots. Is there a deeper reason behind?
Markus

76. Sir,

I have used single exp smoothing for my sets of data but after entering different smoothing constants MAPE are rounded off to whole number without decimal numbers so that I can compare the results. Please help me on this. God bless.

77. hello,
i do have fixed Structured file which i update every week
and built the same capability analysis reports,
can i save it as a template, like macro – to do those report automatic
instead built it over and over again?

thanks!

• Your macro could be quite simple. Three steps:

1) Open your structured file (I’m assuming it is text or CSV file i.e. a file type that Minitab could open).
2) Define the columns of the file (if not done when file is read in).
3) Run process capability via the CAPA command.

For step 1) you could open the file interactively and then capture the code. Here is an example of such code (after making it pretty):

# Open file created by PowerShell file

FType;
CSV;
VNames;
Row 2;
DecSep;
Period;
Field;
Custom “”””;
TDelimiter;
DoubleQuote.

Here is an example of step 2):

# Name the columns

Name c19 “Jobname”
Name c21 “ReturnCode”

Here is an example of step 3). Note that for flexibility the spec limits, etc. have been stored in constants.:

# Do Capability Analysis
# Note: ck82 is a way of referencing a column indirectly; if k82 = 14
# then ck82 references column 14

Capa ck82 1; # The column to be analyzed is the k82th column
NoChart; # We are suppressing graphical output
Lspec k85; # Lower Spec as defined by k85
Uspec k86; # Upper Spec as defined by k86
Pooled;
AMR;
UnBiased;
OBiased;
Toler 6;
Overall; # Not asking for Within analysis
Percent;
CStat;
Name ‘CVarName’; # The Name of the column analyzed
Mean ‘CMean’; # The mean of the data in the column
SDO ‘COStDev’; # The Standard Deviation of the data in the column
PPK ‘CPpk’. # The Ppk of the data in the column

In your case you would not want the NoChart subcommand.

78. Hi,
I have a macro that imports data via ODBC from Excel and plots an individuals chart. To sort the data, say column B, I format using value order -> Order of occurrence in worksheet but this is after the chart has been drawn.

I would like to try to format column B in the macro so that it is sorted correctly before the macro draws the individual chart. I have tried using the copy command language tool to post into the macro when the charts have been updated but this doesn’t appear to work. Any help would be appreciated.
Many thanks, Barry

• If you look up the VOrder command in Help > Help > Session Commands, you will find what you need.

Simply issue the VOrder command before drawing the chart. For instance if your column is named DayValue then your command would look like:

Vorder DayValue;
Worksheet.

Cheers – Mark

79. I want to add spec limits to interval or box plots but Minitab only allows values to be input as Reference lines. I am running Minitab 17 and want to graph multiple columns. Since the limits for each graph are different, I want to exclude graphing rows 3 and 4 but use those values for reference lines.

Example
C1 C2 C3 C4
Label H L W
Row 1 1 5 7 10
Row 2 2 3 8 12
Row 3 USL 6 10 14
Row 4 LSL 2 9 9

• I take it from your table you have 3 variables in other columns from which you are generating your underlying graph? Is Label showing the Variable Names for columns 1 through 4? What do Row 1 and Row 2 represent?

In a macro you could generate graphs within a do loop, referencing the columns using constants. e.g. suppose you want to graph data in columns 11 through 20 you could have code structured like:

DO k701 = 11 : 20 # columns to be graphed
BoxPlot ck701 # Graph the column defined by the constant k701
EndDo

In a similar fashion you can define constants – e.g. for your example,

Let k10 = W[3] # store the value of the third row of column with the name “W” in the constant k10

You can then use this to define the location of a reference line:

Reference 2 k10;

I hope this helps.

80. Hi

I have two data sets, forces computed over the same displacement length. So I graphed them both as a scatter plot, overlaid on eachother, with the same x variable(displacement) as it was identical for both.

Minitab generates the graph fine, but the two lines, for the two sets are connected, and if I edit one (say colour, type etc) then it does it for both! Is there a way to disconnect them, so that changes are independent of the other line. O perhaps there is a better graph I should be using?

Thanks in advance, I understand this might be a silly and novice question, but its really bothering me!

Regards
Tom

• If you look on Page 54 and in this website in

Modules > MTB 02 Intermediate Minitab

You should see a graph that might do what you are trying to accomplish…

Let me know if you are still having problems.

81. Hi

I have a macro which throughout prints values to be copied into Excel, but on minitab 18 pasting these values is harder as it is no longer in a standard text format. Is there a way to print out the values as just highlightable text, or without the headers?

• When you say your macro “prints” values to be copied into Excel do you mean that it outputs to the session window? Is it the way the data is laid out that is challenging or is it the formatting? You can always have your macro output specific data to a worksheet. You can even output to specific cells in the worksheet. e.g. Let MyVar[3] = 3.1415

Not knowing what your issue is I don’t suppose using

Paste > Paste Special > Text

in Excel would help?

• My macro outputs a list of pairs of values in one table, and then I will compare these and select 1 pair which I will want to copy and paste into Excel separately. The issue is that on minitab ’18 the session window is all formatted unlike on old versions (I have previously used ’16 but uni has just changed these). In the old versions it would output to the command area unformatted so I could easily select the data I wanted. Now I can only select the whole table or each column which isn’t helpful. Cheers

82. HI
I have a set of bags weighed at our factory in a weighing scales which are calibrated and sold to customer; he disputes the weight and make claim;I have the weight details from the customers also. how to check in minitab and which test is best suited for this

83. Hi Mark!

I have multiple graphs in a layout and I got them looking the way I want. But when I go copy the command language for the Layout it was unavailable. How do I copy command language for Layout?

Thank you!

• Unfortunately Editor > Copy Command Language only works at the level of each graph. You need to manually code the layout. There are several examples on this website…

84. Hello, I have a question on performing my data with an equation. I want to see how TP changes with distance by using this formula to fit my data.
C= Co*exp^ (kd) + b
Where, C= TP that I want to calculate
Co = Initial TP Value
k =want to calculate which is unknown
d= distance that is known
b= asymptotic value that I want to estimate
When I executing this equation , it showed me Nonlinear Regression: TP = A * “”{EXP(B * Distance) + D

* ERROR * Not enough usable rows of data at iteration 1.)
My data
TP Distance
30.90 0
22.47 438
12.08 779
9.15 1081
7.17 2191
6.39 3368
8.83 4062

• If I am understanding your situation, you are trying to use Stat > Regression > NonLinear Regression. I have never used this form of regression but according to the Help information on the procedure “Minitab estimates parameters by fitting the expectation function to the data using an iterative algorithm that minimizes the sum of squares of the residual error (SSE).”. I think because it is iterative, if your choice of initial values is not close, the iterations will not converge and you will get an error such as you encountered. Just my guess.

Others?

85. Good afternoon! I have a question regarding how to group data after conducting time studies.
Background: For each step along the process that was time studied, the following data exists: the Duration of that step, the Engineer that conducted the study, the Time Study ID, and the Facility that the study was taking place in.
Each Facility will have only a few Engineers, and each engineer will have only a few Time Studies, but each time study can have multiple measurements of Durations. Again, that is because the steps that happen in between each duration have been separated into other worksheets. (If my process goes A, B,C and I time study it for a hour, all of my occurrences of step A are in one worksheet, all of my occurrences of step B are in one worksheet, …)
Example of my Data:
Duration Engineer Facility TimeStudyID
0.33 MBH 001 MBH001-1
0.15 MBH 001 MBH001-1
0.41 MBH 001 MBH001-2
0.28 MBH 001 MBH001-2
0.31 MBH 001 MBH001-2
0.35 SEN 001 SEN001-1
0.30 SEN 001 SEN001-1
0.28 SEN 001 SEN001-2
0.35 SEN 001 SEN001-3
0.34 SEN 001 SEN001-3
0.12 NEG 002 NEG002-1
0.11 NEG 002 NEG002-1
0.44 NEG 002 NEG002-2
0.18 NEG 002 NEG002-3
0.17 NEG 002 NEG002-3
0.20 MSA 002 MSA002-1
0.21 MSA 002 MSA002-1
0.24 MSA 002 MSA002-1
0.23 MSA 002 MSA002-2
0.22 MSA 002 MSA002-2
My data looks just like that but with 15 different facilities.
My Problem: After removing any outliers caused by incorrect captures from the Engineers, I am to find a solid average value across the majority of the Facilities. If a Facility has observations that all seem to be higher or lower than the rest of the network (maybe their layout is slightly different), they can be grouped into their own groups, and from there they can be grouped together or even separated if they differ that much.
(Example… Low Group: 001, 003. Middle Group: 005, 006, 007. High Group: 004. V.High Group: 002.)
In the end, the fewer the groups the better, but if a Facility is statistically different from the rest of the network, they can be taken out.
These groupings of means are then installed at the respective facilities, and used as a standard for measuring production of that step in that process.
SO, after I’ve removed the outliers, what is the best way to find these groupings of data? What tests can I use to support my groupings?

86. Hi,
I would like to write a small .mtb macro to save some minitab charts in a project to a network location so others can see them. I’d like to do this without having to save the minitab project or having to manually save using file > Save graphic as without a problem or exporting to powerpoint either.

I am struggling to be able to use the commands to select the chart that I want and save it. If it was a worksheet that I wanted to save I would use the following commands in the macro:-

Worksheet “barry”
wsave “barry”

Please is it possible to advise what the command would be to select an individual chart or to save the graphics folder? Thank you Mark.

Regards
Barry

87. Barry,

It seems like you are trying to marry manual generation of charts with automated saving of those charts?

The usual model for saving Minitab graphs via a macro is to generate the chart in a macro and save it all in one step. Remember if it is a “native” graph – i.e. from the Graph menu – you can doctor it up to your heart’s content and then click on Editor > Copy Command Language to get the customizations of the graph into macro code.

For instance:

Say I use Calc > Random Data > Weibull to generate some data. Here are the macro commands that show up in the command line window:

Name c1 “MyWeibull”
Random 123 ‘MyWeibull’;
Weibull 4. 95.

I then generate a Histogram and ask for a Weibull distribution fit line:

Histogram ‘MyWeibull’;
Bar;
Distribution;
Weibull.

I then customize the histogram and then use Editor > Copy Command Language to copy the commands into the clipboard that I can then paste into a text editor like Notepad (or better still EditPad Pro).

Histogram MyWeibull;
Table;
Section 1;
Data;
Type 1;
Color 54;
Graph;
Type 1;
Color 115;
Bar;
Type 1;
Color 11;
Distribution;
Weibull;
Grid 2;
SubTitle;
StDist;
Footnote;
FPanel;
Title &
“Histogram of MyWeibull – with Custom Title”;
NoDTitle;
NoDSubtitle.

I then modify the code notepad to do the save to a given path, which in your case would be a network drive:

Histogram MyWeibull;
Table;
Section 1;
Data;
Type 1;
Color 54;
Graph;
Type 1;
Color 115;
Bar;
Type 1;
Color 11;
Distribution;
Weibull;
Grid 2;
SubTitle;
StDist;
Footnote;
FPanel;
Title &
“Histogram of MyWeibull – with Custom Title”;
NoDTitle;
NoDSubtitle;
gsave “C:\MTB\Output\MyWeibull.jpg”;
replace;
jpeg.

The replace subcommand makes sure you don’t get prompted if you are saving an updated graph.

If you add the GMacro header and name and Endmacro at the bottom, you’ve got yourself a working macro that will create the customized graph and save it.

Here is some “bonus” code that will add a subtitle with the date the graph was last updated plus a few more customizations of the graph:

# Create the sub-title

let c151 = now() # C151 is an empty column
date c151 c151; # The now() function returns time as a number;
format(dtyyyy-mm-dd hh:mm). # convert to date in international format
text c151 c151 # Convert the date to a text string
Let k1 = CONCATENATE(“Last Updated: ” ,c151)
erase c151 # Erase no longer needed column

# Create the graph and save

Histogram MyWeibull;
Table 0.8578 0.9755 0.7133 0.8114;
Section 1;
Data;
Type 1;
Color 54;
Data 0.0958 0.8333 0.1235 0.8601;
Type 1;
Color 54;
Graph;
Type 1;
Color 115;
Bar;
Type 1;
Color 11;
Distribution;
Weibull;
Grid 2;
SubTitle;
Offset 0.416666666666667 &
-0.136680327931951;
StDist;
Title &
“Histogram of MyWeibull – with Custom Title”;
Offset -0.123958333333333 &
-0.0293719801014014;
SubTitle k1 ;
PSize 10;
TColor 4;
Offset -0.159375 -0.0871596613335646;
Footnote;
FPanel;
NoDTitle;
NoDSubtitle;
gsave “C:\MTB\Output\MyWeibull.jpg”;
replace;
jpeg.

Enjoy – Mark

88. Hi,
I am not using the macro version but have 3 different columns: 2 with variables and one with data.
I am looking to make this as a boxplot but I don’t want missing combinations of variables and data to show up on the x axis.

For example:
You have 3 students, 3 teachers, and test scores for some of the teacher/student combinations but not every student/teacher combination has data. These show up as blanks in the boxlplot and make the x axis very long and confusing to interpret to other parties. I only want to show the combinations that exist.

Student A has test scores with Teachers 1, 2, but not 3. Student B has test scores with teachers A, C, but not B. For each teacher grouping there will be A, B, C student data on the X axis, even if the data does not exist for a particular combination.

Do you know a way to help with this?

• Easy peasy…

Double click on the X axis labels to edit the X scale. Uncheck “Include empty cells” near the bottom. After you confirm that the change cannot be undone you should have gotten rid of the missing combinations.

• Oh my, I feel very silly. Thank you!

I had been on several other forums with little help.

89. Hi,
Below is an old post by Chhavi Bhatt since 07/17/2017. Now i have an interest in the same question. Can anybody help?

Beginning of Chhavi’s post………..

Anyone could tell me how to install the NADA macro in the already installed Minitab16?

Thank you!
Chhavi

The download included the file: NADA Macros_ReadMe.txt which gives directions on how to “install” these macros. Macros don’t need to be installed, per se. You can just enable the command prompt (Tools > Options > Session Window > Submitting Commands > Enable) and then execute the macro, For instance, if you unzipped the files and moved them to the folder C:\Users\marka\OneDrive\Documents\MTB\Tmp\NADA\NADA-for-MTB-4.4 you could execute the PMLE macro by typing

Things are easier if you move the macros to the default folder for macros (which you can see or change by Tools > Options > Macro Location). On my machine it is:

C:\Program Files (x86)\Minitab\Minitab 18\English\Macros

If they are in your default directory, you can simply type at the MTB> prompt a percent sign (%) followed by the macro name and then the parameters. e.g. in the example above you could type

%PMLE c1 c2 c7 c8

and hit Enter.

I hope this helps. – Mark

90. Hi Mark, I am trying to reverse the x axis order in a scatter plot

Instead of 1 -100 I would like it to go from 100-1

Editor > column properties> Value order does not work on numbers, I can chege those to test but then I cannot create a scatter plot with Text values.

Any ideas? Thanks MJ

• I got creative. Figured it out.

Create new colum
use the Calc function “real number’*-1
run the scatterplot
X axis will show up as a negative number
edit scale, use label tab, specified and change the numbers to the positive .

If you know of another way please let me know. Minitab support did not know how to do it.

MJ

• Actually Minitab came back with the same answer as I did.

91. Hi Dera Mark
I wanna do Factor analysis and my data matrix is 14*9.
Minitab says “ERROR * Must have more (nonmissing) observations than variables”.
Please inform me, if it is possible
Best wishes

• This is not a tool I’ve used. I’ve done multi-variate analysis but not via Factor analysis. I take the message to mean that your matrix must be at least as long as it is wide – i.e. a minimum of 14 x 14. I tried using Minitab’s example dataset and it was happy with a 12 wide by 50 row matrix where I asked for 4 factors, but it gave me your error message when I reduced the data to 9 rows. If you cannot get more data you could choose to include fewer columns in the analysis.

Good Luck.

92. when to use capability analysis six pack and capability analysis in mini tab? what are main differences between them

• The six pack is to look at the data to assess if it should be valid for doing say normal capability analysis. If it looks good in the SixPack you can be better assured that your assessment from using Stat > Quality Tools > Capability Analysis > Normal will be valid.

93. Hello. Is there a way to store or otherwise use the achieved confidence value from a nonparametric tolerance interval in a macro? I want to include it in the subtitle of a custom analysis graph but can’t find a way to access it. I am using SNPTlimits to store the actual upper bound as shown below but don’t see a way to do this for the achieved confidence.

NNTIntervals ‘Fcap’;
NoPara;
PPercent 97.5;
Confidence 95.0;
IType 1;
SNPTlimits C47.

• Sorry for the delay in response. I’ve been enjoying cottage life!

I can find no documentation for NNTIntervals in Minitab 18. Was it from an earlier version of Minitab?

Not fully understanding the analysis you are doing, I’d say that unless you can calculate the achieved confidence yourself, then no I don’t think you can store the value you want.

• I am using Minitab 18 but I agree that the command is not listed in the documentation. I found it by selecting “Show Command Line” and then “Stat > Quality Tools > Tolerance Intervals (Nonnormal Distribution…)” and observing what appeared in the command line.

I am calculating a nonparametric upper tolerance limit for 97.5% reliability and 95% confidence and storing the limit value in C47. The plot includes the achieved confidence in the results but I have not found any way to extract it. I think you are right that there is no way to do this.

• Hi Mark, you were right to suggest calculating the achieved confidence separately and fortunately that can be done easily in Minitab. My solution below for the benefit of anyone else looking to do this. Variable ‘Var1’ with 99% of population in interval. K1 is the sample size of Var1 and K2 is the achieved confidence as a percentage:

1-sided:
N ‘Var1’ K1.
Let K2 = (1 – 0.99^K1)*100

2-sided:
N ‘Var1’ K1.
Let K2 = (1 – 0.99^K1 – K1*(1 – 0.99)*0.99^(K1 – 1))*100

94. Hello,

Is there possibly any way to display the numeric value of %tolerance on the gage chart? The yellow bar is not enough. I am running a macro which graphs data from many columns at once and it would be preferable to have the gage R&R %tolerance populated into the the gage graph automatically.

I have been trying to figure out how to include the gage R&R %tolerance value in the “Misc:” field found on the gage chart with no luck. Is this somehow possible?

Thank you,
Aaron

• With native graphs (the ones under the Graph > menu) you can customize the output substantially and reflect those customizations in the macro code. With graphs that are part of the Stat > menu you have very few customizations – usually just things like Title and GSave. So if I’m understanding you, you cannot reflect the interactive customizations in macro code. Too bad!

95. Why do I get this message?

* ERROR * Graph cannot be created because there are no valid data.

• Well, at the risk of stating the obvious, you get this when there is no valid data to plot. It could be your X, Y or whatever variable is being graphed has no valid data in the column. More often it happens when you use an INCLUDE (or EXCLUDE) statement and none (or all) of the data matches the criteria statement.

96. As one of the other questions above mentions, the new formatted output in the session window causes difficulties. I often do 1,000-3,000 t-tests with a macro. I used to be able to copy all these results and paste them into a file for sorting and other manipulation. This doesn’t seem possible in Minitab 18. Nor does it seem possible to clear the entire output at once so that the window contains just one set of results. I know I can save the output window to a file, but this means I have to look through the whole file to find the beginning of the set of results I want. Am I just missing something obvious?

• I just noticed this in my Spam folder!

Here are the options I know for the “improved” session window.

>> if you mouse over the output in question the “Menu” drop down shows up in the upper right corner of the output and you can save that individual test’s output
>> you can output the session window via “File > Save Session Window as” and then choose file type of RTF.

However it sounds like you know this. If you open that RTF file in Word you can then deal with it e.g. search for “One-Sample” to find the first T-test.

Within macros you can do messy things like create your own text files so you could create just the text output you want but that would be cumbersome.