The Elsmar Cove Business Systems and Standards Discussion Forums Running Code as a Simulation in Minitab
 Forum User Name Keep Me Logged In Password
 Register Photo Albums Blogs FAQ Registered Visitors Social Groups Calendar Search Today's Posts Mark Forums Read

 Elsmar Cove Forum Visitor Notice(s)

# Running Code as a Simulation in Minitab

 Elsmar XML RSS Feed Monitor the Elsmar Forum Sponsor Links Courtesy Quick Links Links Elsmar Cove visitors will find useful in the quest for knowledge and support: International Standards Bodies - World Wide Standards Bodies International Organization for Standardization - ISO Standards and Information Quality Digest

 Thread Tools Search this Thread Rate Thread Content Display Modes
Post Number #1
29th April 2012, 04:06 AM
 jiao88 Total Posts: 11
Running Code as a Simulation in Minitab

Hi all,

I am new to Minitab. Refer to my code, if I were to run the code as simulation for like 1000 time, how can I store the 1000 results for my coefficient every time I run it? My current code will replace the coefficient to the latest coefficient only Please advice.

Name C1 "u"
Name C2 "t"
Name C4 "x"
Name C5 "COEF1"
Name C6 "SECO1"
Name C7 "CLCO1"
Name C8 "CLCO2"

Random 20 c1;
Uniform 0.0 1.0.
Random 20 c4;
Normal 0.0 1.0.

let c2=exp(0.4*log(-log(1-u))+3+3*x)

Lregression 't'=x;
Weibull;
Coefficient 'COEF1';
Secoefficient 'SECO1';
Clcoefficient 'CLCO1'-'CLCO2';

Brief 2;
Confidence 95.0.

let k1=1
let k2=10
let Ck2(1)=C5(1)
let Ck2(2)=C5(2)
let Ck2(3)=C5(3)

let k1=k1+1
let k2=k2+1

 Sponsored Links
Post Number #2
30th April 2012, 02:16 AM
 Stijloor Total Posts: 15,223
Re: Running Code as a Simulation in Minitab

A Quick Bump!

Can someone help?

Thank you very much!!

Stijloor.
 Sponsored Links
Post Number #3
30th April 2012, 11:55 AM
 Allattar Total Posts: 234
Re: Running Code as a Simulation in Minitab

Try stacking it into a new columns using the stack command.

Then build a subscript column to identify the run number.
 Thanks to Allattar for your informative Post and/or Attachment!
Post Number #4
3rd May 2012, 10:44 PM
 jiao88 Total Posts: 11
Re: Running Code as a Simulation in Minitab

If I use the stack command, meaning I need to list out all the result for 1000 replications before I stack it? or I can still stack it into 1 column even though I do not have the result for 1000 replications?
Post Number #5
4th May 2012, 12:48 AM
 jiao88 Total Posts: 11
Re: Running Code as a Simulation in Minitab

My current way of running a simulation is just execute the .mtb file for 1000 times. But seems like the part

let k1=1
.
.

let k1=k1+1

didnt run at all. Is my way of doing simulation is wrong?
Post Number #6
5th May 2012, 01:50 AM
 wang1568 Total Posts: 10
Re: Running Code as a Simulation in Minitab

You just need a "do loop" control Statements to repeat 1000 calculations and only a minitab macro can do that.
 Thanks to wang1568 for your informative Post and/or Attachment!
Post Number #7
9th May 2012, 12:21 PM
 steelejc15425 Total Posts: 7
Re: Running Code as a Simulation in Minitab

I agree with Wang1568, you will need a macro to do the loop.

You can get more information from Help > Help >Macros (select on left side).

I think this will get you started though. Notice that your file has to start with gmacro, followed by a name for the macro, and that your file has to end with endmacro.

To run your macro, you will have to have your cursor in the white window (Session Window), then on the menus click Editor > Enable Commands.

If you save it in the Minitab macros folder, you can invoke it by typing the name after a % symbol. Otherwise, type the full file path after a % symbol:
%C:\Users\you\sample.mac

where you type your file name instead of sample.mac.

Let us know if you get stuck!

gmacro
macroname

Name C1 "u"
Name C2 "t"
Name C4 "x"
Name C5 "COEF1"
Name C6 "SECO1"
Name C7 "CLCO1"
Name C8 "CLCO2"
let k1=1
let k2=10

do k1 =1:10 10
Random 20 c1;
Uniform 0.0 1.0.
Random 20 c4;
Normal 0.0 1.0.
let c2=exp(0.4*log(-log(1-u))+3+3*x)
Lregression 't'=x;
Weibull;
Coefficient 'COEF1';
Secoefficient 'SECO1';
Clcoefficient 'CLCO1'-'CLCO2';

Brief 2;
Confidence 95.0.
let Ck2(1)=C5(1)
let Ck2(2)=C5(2)
let Ck2(3)=C5(3)

let k2=k2+1
enddo
endmacro
 Thanks to steelejc15425 for your informative Post and/or Attachment!
Post Number #8
10th May 2012, 08:57 AM
 jiao88 Total Posts: 11
Re: Running Code as a Simulation in Minitab

Thanks alot! appreciate it!

Lower Navigation Bar
 The Elsmar Cove Business Systems and Standards Discussion Forums Running Code as a Simulation in Minitab

 Bookmarks

 Visitors Currently Viewing this Thread: 1 (0 Registered Visitors (Members) and 1 Unregistered Guest Visitors)
 Thread Tools Search this Thread Search this Thread: Advanced Forum Search Display Modes Rate Thread Content Linear Mode Rate Thread Content: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Forum Posting Settings You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Emoticons are On [IMG] code is On HTML code is Off Forum Rules

 Similar Discussion Threads Discussion Thread Title Thread Starter Forum Replies Last Post or Poll Vote berseak ISO 9000, ISO 9001, and ISO 9004 Quality Management Systems Standards 4 5th January 2012 07:46 AM gel270 Quality Tools, Improvement and Analysis 4 5th July 2011 08:59 PM Reiko Shiratori EU Medical Device Regulations 7 31st October 2010 10:19 AM cristiano74 Using Minitab Software 2 9th January 2008 05:35 AM mustafiz Calibration and Metrology Software and Hardware 2 18th December 2006 12:45 AM

The time now is 03:49 AM. All times are GMT -4.
Your time zone can be changed in your UserCP --> Options.

 Contact Us - The Elsmar Cove Home Page - Privacy & DMCA/Copyright Information - Terms of Service - Top

 The Deming PDCA Cycle Implementing A Quality Management System FMEA Information APQP Information Auditing Information 8-D Problem Solving Statistics Error Proofing (Poka Yoke) Brainstorming Identifying Waste Pull Systems Lead Time Reduction Planned Maintenance Quick Setup Discovering Change Process Capability - Cp vs. Cpk Histogram Animation Process Loop Animation Taguchi Loss Function Fishbone / Cause and Effects Animation More Free Elsmar Files

NOTE: This forum uses "Cookies"