MACRO ################################################################# # Date version Modify Note # 2014/03/25 v.01 Andrew Lee Create! # # #---------------------------------------------------------------- # # This macro is used to calculate the miss rate and false alarm rate # for Attribute Agreement Analysis in MSA 4th edition. # ################################################################# # # Neither Minitab, Inc. nor the author(s) of this MACRO makes any claim # of or offers any Warranty whatsoever with regard to the accuracy of # this MACRO or its suitability for use. Minitab, Inc. and the author(s) # of this MACRO each hereby disclaims any Warranty and/or liability with # respect thereto. # ################################################################# DRAAA appr resp ref MCOLUMN appr resp ref MCOLUMN a r rf uniq1 freq1 uniq2 freq2 names rate1 rate2 MCONSTANT dr1 dr2 i j k.1-k.5 MRESET BRIEF 0 NOECHO Notitle tally resp; store uniq1 freq1. tally ref; store uniq2 freq2. Count uniq1 k.1 Count uniq2 k.2 IF k.1<>2 Brief 1 NOTE **Error Invalid #reference categories. EXIT ENDIF DO i=1:k.2 DO j = 1:k.1 IF uniq2[i]=uniq1[j] Break ENDIF IF j=k.1 Brief 1 NOTE **Error Incorrect response EXIT ENDIF ENDDO ENDDO Tally appr; Store uniq2 freq2. Copy uniq1 k.2 k.3 Let k.4 = Conc("%",k.2,"->",k.3) Let k.5 = Conc("%",k.3,"->",k.2) Name rate1 k.4 rate2 k.5 Count uniq2 k.1 Text appr a Copy uniq2 names DO i=1:k.1 Copy resp ref r rf; Include; where "a=uniq2[i]". Let rate1[i] = sum(r<>rf and rf=k.2)/sum(rf=k.2) Let rate2[i] = sum(r<>rf and rf=k.3)/sum(rf=k.3) ENDDO Brief 1 MTITLE "Disagreement Rate Table" #Write "Appraiser" k.4 k.5; # Format(3x,A9, 6x, A9,2x,A9). NAME names "ByAppr", rate1 k.4, rate2 k.5 #Write names rate1 rate2; # Format(5x,A7,6x, %7.2,2x, %7.2). Fnum rate1 rate2; percent 2. print names rate1 rate2 ENDMACRO