macro grrsim msmt part op mcolumn opmeans prtmeans msmt part op mconstant nparts kops lrepli nl nomsmts mconstant index thispart thatop #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. #If there are n parts, k operators, and l replicates there are a total #of nomsmts=n*k*l observations. If the analysis is by two way ANOVA the #part variation can be recovered from: # sigma(parts)=sqrt(MS(parts)/k/l) #The reproducibility can be recovered from: # sigma(operators)=sqrt(MS(operators)/n/l) #The repeatability can be recovered from: # sigma(error)=sqrt(MS(error)) #Example call: # mtb> cd c:/doetext/ch6 # mtb> %grrsim c1 c2 c3 #cd c:/doetext/ch6 #%grrsim c1 c2 c3 #Follow this macro with a two-way ANOVA or GRR study name msmt 'Msmt' name part 'Part' name op 'Op' let nparts=10 #nparts is number of parts let kops=2 #kops is number of operators let lrepli=2 #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 rand nparts prtmeans; #prtmeans is column of part means normal 10.00 0.050. #part mean and variability rand kops opmeans; #opmeans is column of operator means normal 0 0.010. #reproducibility rand nomsmts msmt; normal 0 0.010. #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 endmacro