/* Author: Dr phil Jörg Michael Müller, /* Schmeddingstraße 50 48149 Münster /* Telefon: (02 51) 83 – 5 64 54 /* Telefax: (02 51) 83 – 5 22 75 /* Senior Researcher at the Department of Child and Adolescent Psychiatry University Hospital Münster /* Website: wwwDOTklinikumDOTuni-muensterDOTde/institute/kjp/ /* Personal-Websites: /* http://wwwDOTpsychological-testsDOTde /* http://wwwDOTjoergmmuellerDOTde/defaultDOThtm /* 1 Website: http://wwwDOTJoergMMuellerDOTde/defaultDOThtm /* 2DOT Website: http://wwwDOTpsychological-testsDOTde /* /* Content: SPSS-Macro to compute the PDTS and PDPP score of a psychological testDOT /* Additional information about the macro could be retrieved from the following papersDOT /* /* Reference: PLEASE CITE IF YOU USE THE PROGRAMDOT /* Müller, J M (2006) Probability of obtaining two statistically different test scores as a test index /* Educational and Psychological Measurement, 66, 601-611 7: 0DOT831 /* Müller, J M (2006) SAS macros to compute the test index PDTS /* Applied Psychological Measurement, 30, 345-346DOT /* Müller, J M, Postert, C Furniss, T, Beyer, T, & Achtergarde, S (2009) /* Comparison of eleven short forms of the Symptom Checklist Revised (SCL -90-R) /* Journal of Psychopathology and Behavioral AssessmentDOT DOI: 10DOT1007/s10862-009-9141-5DOT *******************************************************************************************. DEFINE PDTS( name = !TOKENS(1) /reli = !TOKENS(1) /samplesize =!TOKENS(1)) * name is the name of your variable containing your test score. * reli is the reliability of your test score - this could be estimated by Cronbachs alpha in a separated analysis. * samplesize is the number of valid number of observation of your test scores. * 0 Step Start SPSS and open only the one file which contain you test score. get FILE 'P:\Forschung\test.sav' /keep = !name. DATASET ACTIVATE DatenSet1. EXECUTE. DATASET name !name. EXECUTE. DATASET ACTIVATE !name . * Here we supress previous title statements and some error output resulting from renaming variables of data with cases less then 100. TITLE . Subtitle . *set ERRORS = none. *set MESSAGES = none. *set RESULTS = none. *set MEXPAND = on. *set MPRINT=OFF. **set UNDEFINED = NOWARN. set width = 110. EXECUTE. * 1 Step We create a new dataset named mydata containing only the test score for further computation. * This is automatically done by invoking the SPSS macro call PDTS. * 2 Step COMPUTE create a z-score of the testscore in the new dataset. DESCRIPTIVES VARIABLES= !name /SAVE. EXECUTE . * 3 Step We exclude Missing data from the dataset. DATASET ACTIVATE !name. SELECT IF (MISSING( !name )=0). EXECUTE. * Only the z-scores are save later. DELETE VARIABLES !name . * 4 Step we flip the data set to order each z-score standardized testscore no more below but now beside each other. FLIP VARIABLES=!CONCAT(z,!name ). SAVE OUTFILE=!CONCAT(PDTS_, !name). EXECUTE . DATASET name !CONCAT(PDTS_, !name). DATASET ACTIVATE !CONCAT(PDTS_, !name). * 5 Step we compute the critical difference that is the minimum distance two observed test score should differ. * COMPUTE critical difference. COMPUTE reli= !reli. COMPUTE samplesize = !samplesize. COMPUTE CriticalDiff =1.96* (SQRT(2 *(1-(reli/100)))). COMPUTE zeit = $TIME. formats zeit (DATETIMEw). Print / zeit . EXECUTE. * 6 Step we compute the number of all pair comparisons. * The TPU is no more computed and replaced by a real counting of comparisons. COMPUTE TTPU=(samplesize * (samplesize -1) )/2. * 7 Step We renaming the variablenames to allow automated variable referencing. !DO !v = 1 !TO 9 !BY 1 rename variables (!CONCAT(var00, !v) = !CONCAT(var, !v)). !DOEND !DO !v = 10 !TO 99 !BY 1 rename variables (!CONCAT(var0, !v) = !CONCAT(var, !v)). !DOEND * 8 Step We add a variable named below and above that count later all significant test score comparisons producing the EPU. COMPUTE Below = 0. COMPUTE Above = 0. COMPUTE ETPU = 0. EXECUTE. * 9 Step We compute the difference between any test score comparison. * and producing a large amount of variable containing differences. * Therefore these variables are so called scratch variables. !DO !v = 1 !TO !samplesize !BY 1 !DO !w =1 !TO !samplesize !BY 1 COMPUTE !CONCAT(#,d,!v,_,!w ) = (!CONCAT(var,!v)) - (!CONCAT(var,!w)) . * We count only comparison with non -missings. do if !CONCAT(#,d,!v,_,!w ) ne SYSMIS. COMPUTE ETPU=ETPU+1. end if. * 10 Step We decide if two test scores are significant different. do if (!CONCAT(#,d,!v,_,!w ) > CriticalDiff ) . COMPUTE Above = Above + 1. end if. do if (!CONCAT(#,d,!v,_,!w) < (-CriticalDiff)). COMPUTE Below = Below + 1. end if. !DOEND !DOEND EXECUTE. compute points=below + above. * Each score was double counted a-b and b-a. * This is corrected here. compute EPU=points/2. compute ETPU=(ETPU - !samplesize)/2 . EXECUTE. * We compute the final Probability of Distinct test results in percent. Compute PDTS_CTT=(EPU/ETPU)*100. Compute PDTS_CTT2=(EPU/TTPU)*100. EXECUTE. EXECUTE. * We enable error printings and output again. set ERRORS = listing. set MESSAGES = listing. set MPRINT=on. set RESULTS = listing. set UNDEFINED = WARN. * We print the results. TITLE "The SPSS-macro runs successfully!". Subtitle "Your PDTS_CTT score is printed below in %!". Print / PDTS_CTT. EXECUTE. DELETE VARIABLES var1 to !CONCAT(var,!samplesize ) above below points. EXECUTE. !ENDDEFINE. * 11 Step Here insert your test score name, test score reliability. * - prefered cronbachs alpha - and the sample size without missing data. PDTS name = testscore reli = 77 samplesize = 12.