The Elsmar Cove Forum 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

 Search the Elsmar Cove @import url(http://www.google.com/cse/api/branding.css); Custom Search Monitor the Elsmar Forum Monitor New Forum Posts Follow Marc & Elsmar Elsmar Cove Groups Sponsor Links Donate and \$ Contributor Forum Access Courtesy Quick Links Links that Elsmar Cove visitors will find useful in your quest for knowledge: Howard'sInternational Quality Services Marcelo Antunes'SQR Consulting Bob Doering'sCorrect SPC - Precision Machining NIST's Engineering Statistics Handbook IRCA - International Register of Certified Auditors SAE - Society of Automotive Engineers Quality Digest Portal IEST - Institute of Environmental Sciences and Technology ASQ - American Society for Quality

 Thread Tools Search this Thread Rate Thread Content Display Modes
#1
29th April 2012, 04:06 AM
 jiao88 Involved in Discussions   Registration Date: Apr 2012 Posts: 11 Thanks Given to Others: 5 Thanked 0 Times in 0 Posts Karma Power: 11 Karma: 10
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
#2
30th April 2012, 02:16 AM
 Stijloor Super Moderator   Registration Date: May 2003 Location: Charlotte, North Carolina. Posts: 14,522 Thanks Given to Others: 3,189 Thanked 4,523 Times in 3,206 Posts Karma Power: 1548 Karma: 25228
Re: Running Code as a Simulation in Minitab

A Quick Bump!

Can someone help?

Thank you very much!!

Stijloor.
 Sponsored Links
#3
30th April 2012, 11:55 AM
 Allattar Appreciated Member   Registration Date: Jan 2008 Location: UK Posts: 234 Thanks Given to Others: 15 Thanked 170 Times in 111 Posts Karma Power: 56 Karma: 3385
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!
#4
3rd May 2012, 10:44 PM
 jiao88 Involved in Discussions   Registration Date: Apr 2012 Posts: 11 Thanks Given to Others: 5 Thanked 0 Times in 0 Posts Karma Power: 11 Karma: 10
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?
#5
4th May 2012, 12:48 AM
 jiao88 Involved in Discussions   Registration Date: Apr 2012 Posts: 11 Thanks Given to Others: 5 Thanked 0 Times in 0 Posts Karma Power: 11 Karma: 10
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?
#6
5th May 2012, 01:50 AM
 wang1568 Involved in Discussions   Registration Date: Jul 2006 Location: Taiwan Posts: 10 Thanks Given to Others: 0 Thanked 2 Times in 2 Posts Karma Power: 36 Karma: 603
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!
#7
9th May 2012, 12:21 PM
 steelejc15425 Getting Involved (6 to 9 Posts)   Registration Date: May 2010 Location: Pennsylvania, USA Posts: 7 Thanks Given to Others: 8 Thanked 7 Times in 5 Posts Karma Power: 18 Karma: 45
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!
#8
10th May 2012, 08:57 AM
 jiao88 Involved in Discussions   Registration Date: Apr 2012 Posts: 11 Thanks Given to Others: 5 Thanked 0 Times in 0 Posts Karma Power: 11 Karma: 10
Re: Running Code as a Simulation in Minitab

Thanks alot! appreciate it!

Lower Navigation Bar
 The Elsmar Cove Forum Running Code as a Simulation in Minitab

Do you find this discussion thread helpful and informational?

 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 Smilies 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 - Questions and Discussions 4 5th January 2012 06: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 04:35 AM mustafiz Calibration and Metrology Software and Hardware 2 17th December 2006 11:45 PM

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

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

 The Deming PDCA Cycle ISO 9001 QMS Implementation 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

Marc Timothy Smith - Elsmar.com
8466 LeSourdsville-West Chester Road, Olde West Chester, Ohio 45069-1929
513 341-6272