macro gelgrrsim msmt part op bright; action pickone. #GEL LTC STUDENTS: YOU ARE FORBIDDEN TO LOOK IN HERE! mcolumn opmeans prtmeans msmt part op bright randord standord mconstant sparts srepro srepeat sbright pickone mconstant nparts kops lrepli nl nomsmts mconstant index thispart thatop #Mod 2/8/01 PGM: Modified grrsim.mac for grr simulation for GEL LTC #Mod 1/22/02 PGM: Randomized the observations by part, blocked by op. #By PGMathews, 217 Third Street, Fairport Harbor, OH 44077 440-350-0911 #Copyright 9 February 2000 PGMathews #Written for Version 12 of Minitab #This macro is a simulator for a gage error long study. It creates a #data set with specified numbers of parts, operators, and replicates. #The user sets the values of the repeatability, reproducibility, and #part variation. The user must specify the three output columns to be #used corresponding to the measurement values, the part ID, and the #operator ID. #Example call: # mtb> cd c:/doetext/ch6 # mtb> %gelgrrsim c1 c2 c3 c4 # subc>action 2. #cd c:/doetext/ch6 #%gelgrrsim c1 c2 c3 c4; #action 2. if action=0 note You must select a management action. Please try again. return endif name msmt='Msmt' part='Part' op='Op' bright='Bright' #These actions reduce the reproducibility: If (pickone=2) OR (pickone=3) OR (pickone=4) OR (pickone=5) OR (pickone=6) let srepro=0.05 else let srepro=0.30 #no change in reproducibility endif #These actions reduce the repeatability: If (pickone=1) OR (pickone=4) let srepeat=0.08 else let srepeat=0.10 #no change in repeatability endif #Follow this macro with a two-way random effects ANOVA or GRR study let nparts=12 #nparts is number of parts let kops=4 #kops is number of operators let lrepli=3 #lrepli is number of replicates let nl=nparts*lrepli #special variable required to use set command below let nomsmts=nparts*kops*lrepli #total number of measurements set op #ID numbers for the operators (1:kops)nl end set part #ID numbers for the parts kops(1:nparts)lrepli end let sparts=0.25 rand nparts prtmeans; #prtmeans is column of part means normal 15.00 sparts. #part mean and variability rand kops opmeans; #opmeans is column of operator means normal 0 srepro. #reproducibility rand nomsmts msmt; normal 0 srepeat. #repeatability do index=1:nomsmts let thispart=part(index) #the part ID let thatop=op(index) #the operator ID let msmt(index)=prtmeans(thispart)+opmeans(thatop)+msmt(index) #part+operator+error terms enddo let sbright=0.10 rand nomsmts bright; normal 0 sbright. let bright=exp(bright) let bright=bright/max(bright) let bright=round(bright,2) call randomizeit standord randord msmt part op bright; blocking op. note note The observations appear in the order that they were taken. endmacro ################################################################################## macro randomizeit stand run resp x.1-x.m; blocking block. # resp CAN BE DROPPED FROM THE COMMAND LINE, IF IT IS BLANK # EX: randomizeit stand run x.1-x.m #Where, #stand: a column for the standard order, consecutive numbers # will be written into this column and initial values here will be over-written. #run: a blank column for the run order to be generated #resp: column with responses #x.1-x.m: columns with data, usually the levels of variables in a designed exp't #block: a column identifying how subsets of the experiment are to be blocked #Copyright © 28 November 2000 Mathews and Malnar #Rev. 1.0 for Minitab V13.2 (BEK) #Rev 1.1 for Minitab 13.3 (BEK) added blocking subcommand 02/06/01 #This macro creates a random run order which randomizes the response values. #This is acheived by creating random normal values, and the data sets are indexed, #then sorted in ascending order. A new index is created for the run order. #The blocking subcommand allows the user to randomize the values within blocks. #Mathews, Malnar & Bailey #217 Third Street, Fairport Harbor, OH 44077 #(440)350-0911 #pmathews@apk.net #This macro sould be copied into the Minitab source macros directory for #immediate use, otherwise a change directory (cd) command will be needed. #Example call: # mtb> %randomizeit c1 c2 c4 c5-c9; # subc> blocking c3. # #Copy the following line, minus the leading #, to the command line: #%randomizeit c1 c2 c4 c5-c9; # blocking c3. mcolumn stand run resp x.1-x.m block mconstant k Name run 'Run Order' #names columns for easy reference for the user name stand 'Standard Order' let k=count(x.1) #counts missing and non-missing values Set stand #index for standard order 1:k End. Random k run; #creates random normal values for randomizing Normal 0.0 1.0. If Blocking Sort stand run resp x.1-x.m block stand run resp x.1-x.m block; By block. #sorts by block Sort stand run resp x.1-x.m block stand run resp x.1-x.m block; By run. #sorts using generated random normal values Sort stand run resp x.1-x.m block stand run resp x.1-x.m block; By block. else Sort stand run resp x.1-x.m stand run resp x.1-x.m; By run. endif Set run #Creates run order 1:k end. endmacro.