set printback=off. DEFINE ProfSim ( VList1 !CharEnd('/') /Vlist2 !CharEnd('/') /Coeff !Default(PC) !CharEnd('/') /Neutral !Default(0) !CharEnd('/') /CorVar !CharEnd('/') /F_ZVar !CharEnd('/') /MinVar !Default(2) !CMDEnd). compute #n = 0. do repeat #varn1 = !VList1 /#varn2 = !Vlist2. + if not(missing(#varn1)or missing(#varn2)) #n = #n+1. end repeat. !IF (!MinVar=0) !THEN. !LET !NV=1. !ELSE. !LET !NV=!MinVar. !IFEND. compute #x1 = 0. compute #x2 = 0. compute #x1_2 = 0. compute #x2_2 = 0. compute #term4= 0. do repeat #varx1 = !VList1 /#varx2 = !VList2. + do if (#n >= !NV) and not(missing(#varx1) or missing(#varx2)). - compute #x1=#x1+#varx1. - compute #x1_2=#x1_2+#varx1*#varx1. - compute #x2=#x2+#varx2. - compute #x2_2=#x2_2+#varx2*#varx2. - compute #term4=#term4+(#varx1+#varx2)*(#varx1+#varx2). + end if. end repeat. compute #term1=0. compute #term2=0. compute #term3=0. do if (#n >= !NV). + compute #term1=(#x1+#x2)*(#x1+#x2)/(2*#n). + compute #term2=#x1_2+#x2_2. + compute #term3=(#x1*#x1+#x2*#x2)/#n. + compute #term4=#term4/2. + compute #x1 = #x1/#n. + compute #x2 = #x2/#n. end if. !IF (!UpCase(!Coeff)=RC) !THEN. + compute #x1 = !neutral. + compute #x2 = !neutral. !IFEND. !IF (!UpCase(!Coeff)=H) !THEN. + compute #x1 = 0. + compute #x2 = 0. !IFEND. compute #t1 = 0. compute #t2 = 0. compute #t3 = 0. do repeat #var1 = !VList1 /#var2 = !Vlist2. + if (#n >= !NV) and not(missing(#var1) or missing(#var2)) #t1 = #t1 + (#var1-#x1)*(#var2-#x2). + if (#n >= !NV) and not(missing(#var1) or missing(#var2)) #t2 = #t2 + (#var1-#x1)*(#var1-#x1). + if (#n >= !NV) and not(missing(#var1) or missing(#var2)) #t3 = #t3 + (#var2-#x2)*(#var2-#x2). end repeat. compute #t4 = #t2*#t3. compute !CorVar = 99. compute !F_ZVar = 99. do if (#t4 > 0) and (#n > 1). !IF (!UpCase(!Coeff)<>IC) !THEN. + compute !CorVar = #t1/sqrt(#t4). !ELSE. + compute MSp = (#term4-#term1)/(#n-1). + compute MSres = (#term2-#term3-#term4+#term1)/(#n-1). + compute MSr = (#term3-#term1). + compute !CorVar = (MSp-MSres)/(MSp+MSres+2*(MSr-MSres)/#n). !IFEND. else. + compute !CorVar = 99. end if. missing values !CorVar (99). exe. do if abs(!CorVar) < 0.995054753. + compute !F_ZVar = 0.5*ln((1+!CorVar)/(1-!CorVar)). else if !CorVar >= 0.995054753. + compute !F_ZVar = 3.0. else if !CorVar <= -0.995054753. + compute !F_ZVar = -3.0. end if. if sysmis(!F_ZVar) !F_ZVar = 99. missing values !F_ZVar (99). print formats !CorVar !F_ZVar (F7.4). !IF (!UpCase(!Coeff)=PC) !THEN. variable labels !CorVar 'profile corr. r' /!F_ZVar 'F.-Z r'. !IFEND. !IF (!UpCase(!Coeff)=RC) !THEN. variable labels !CorVar 'profile simil. rc' /!F_ZVar 'F.-Z rc'. !IFEND. !IF (!UpCase(!Coeff)=H) !THEN. variable labels !CorVar 'profile match. H' /!F_ZVar 'F.-Z H'. !IFEND. !IF (!UpCase(!Coeff)=IC) !THEN. variable labels !CorVar 'profile correl. icc' /!F_ZVar 'F.-Z icc'. !IFEND. desc !CorVar !F_ZVar. !EndDefine. set printback=on. exe. /* ----------------------------------------------- */ /* */ /* ProfSim calculates a measure of profile */ /* similarity per person (object) and its */ /* corresponding Fisher's Z-value based on two */ /* sets (lists) of variables. */ /* */ /* The syntax of ProfSim: */ /* */ /* PROFSIM VLIST1 = (list 1 of variables) */ /* /VLIST2 = (list 2 of variables) */ /* [/COEFF = {PC} (= Default) */ /* {RC} */ /* {H} */ /* {IC}] */ /* [/NEUTRAL= (neutral value) */ /* (Default = 0)] */ /* /CORVAR = (name of resulting variable */ /* containing the measure of */ /* profile similarity) */ /* /F_ZVAR = (name of resulting variable */ /* containing Fisher's Z-value) */ /* [/MINVAR = (minimum number of variables */ /* with valid values) */ /* (Default = 2)]. */ /* */ /* The type of profile similarity measure can be */ /* specified by using /COEFF : */ /* /COEFF=PC : product-moment-correlation r; */ /* using this option no neutral value */ /* should be specified; */ /* /COEFF=RC : profile similarity coefficient */ /* according to Cohen (1969) that is */ /* invariant for reflection of the */ /* variables; using this option a */ /* neutral value of the scale (middle */ /* point of the scale) has to be */ /* specified; if 0 (Zero) is used as */ /* neutral value (= default) the */ /* profile similarity coefficient */ /* is identical to the profile */ /* matching coefficient H (see below);*/ /* /COEFF=IC : intraclass-correlation (Shrout */ /* & Fleiss, 1979, model 2); using */ /* this option no neutral value */ /* should be specified; */ /* /COEFF=H : profile matching coefficient H */ /* according to Sjöbert & Holley */ /* (1967) (= Tucker's phi; Harman, */ /* 1967) or Burts (1937) that is not */ /* adjusted for mean differences; */ /* using this option no neutral */ /* value should be specified. */ /* */ /* References: */ /* Burt, C. (1937). Methods of factor-analysis */ /* with and without successive approximation. */ /* British Journal of Educational Psychology, 7, */ /* 172-195. */ /* Cohen, J. (1969). rc: A profile similarity co- */ /* efficient invariant over variable reflection. */ /* Psychological Bulletin, 71, 281-284. */ /* Harman, H.H. (1967). Modern factor analysis. */ /* (2nd ed.,rev.) Chicago: University of Chicago */ /* Press. */ /* Shrout, P.E. & Fleiss, J.L. (1979). Intraclass */ /* correlations: Uses in assessing rater reliab- */ /* ility. Psychological Bulletin, 86, 420-428. */ /* Sjöberg, L. & Holley, J.W. (1967). A measure of */ /* similarity between individuals when scoring */ /* directions of variables are arbitrary. Multi- */ /* variate Behavioral Research, 2, 377-384. */ /* */ /* Examples: */ /* */ /* PROFSIM VLIST1 = skoni01a to skoni22a */ /* /VLIST2 = skonr01a to skonr22a */ /* /CORVAR = CProfRI */ /* /F_ZVAR = ZProfRI */ /* /MINVAR = 20. */ /* */ /* calculates the product moment correlation as a */ /* measure of profile similarity for sets of at */ /* least 20 variables with valid values. */ /* */ /* PROFSIM VLIST1 = skoni01a to skoni22a */ /* /VLIST2 = skonr01a to skonr22a */ /* /COEFF = RC */ /* /NEUTRAL= 2.5 */ /* /CORVAR = CProfRI */ /* /F_ZVAR = ZProfRI */ /* /MINVAR = 20. */ /* */ /* calculates the profile similarity coefficient */ /* rc for a four-point Likert scale (anchors = 1, */ /* 2, 3, and 4) for sets of at least 20 variables */ /* with valid values. */ /* ----------------------------------------------- */.