|
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
|