* Author: Dr. Jörg Michael Müller, Uni Tübingen, 07071-2978353; * Adress: Friedrichstrasse 21, 72072 Tübingen, Germany * Email: JMMueller@uni-tuebingen.de * 1. Website: http://www.JoergMMueller.de/default.htm * 2. Website: http://www.psychological-tests.de * * Content: SAS-Macro to compute the PDTS and PDPP score of a psychological test; * Additional information about the macro could be retrieved from the following papers: * * Reference: PLEASE CITE IF YOU USE THE PROGRAM: * Müller, J. M. (2005). SAS MACROS TO COMPUTE THE PROBABILITY OF DISTINCT TEST RESULTS. Applied Psychological Measurement; * Müller, J. M. (2005). The Probability of Obtaining Two Statistically Different Test Scores as a Basic Test Characteristic. Educational and Psychological Measurement. * * * Table of Contents: * Name of Macro * Function: *******************************************************************************************; * %Log_on %Log_on * Enable/Disable the SAS-Log * %mac_on %mac_on * Enable/Disable SAS-Macro statements in the Log * %PDTS(FILE, RELI, SCORE); * Compute the PDTS; * To have an example for the PDTS macro, please make the permanent * SASfile 'sas_test.sas7bdat' actual in your Work-library, e.g. by an libname statement; *****************Mini Macro Statements to speed up BEGIN **********************; %macro log_on; options source notes date; %mend log_on; %macro log_off; options nosource nonotes nodate; %mend log_off; %macro mac_on; options mprint merror mlogic serror symbolgen; %mend mac_on; %macro mac_off; options nomlogic nomprint nomerror nosymbolgen nomrecall; %mend mac_off; %log_off %mac_off *****************Mini Macro Statements to speed up END **********************; *****************Macro Content BEGIN **********************; %macro content2(datain, charnum); %global vmax obs; data d1; set macro.&datain; call symput('obs',left(_n_)); run; proc contents data=macro.&datain noprint out=d2; %if &charnum=1 %then %do; data d3; set d2; where type=1; %end; %if &charnum=2 %then %do; data d3; set d2; where type=2; %end; %if &charnum=3 %then %do; data d3; set d2; %end; call symput('vmax',left(_n_)); run; data d4; set d3; %do i= 1 %to &vmax; %global v&i l&i t&i f&i; %end; call symput('v'||left(_n_), name); call symput('l'||left(_n_), label); call symput('t'||left(_n_), type); call symput('f'||left(_n_), format); call symput('p'||left(_n_), npos); run cancel; %mend content2; *****************Macro Content END **********************; *****************Macro PDTS BEGIN **********************; %macro PDTS(FILE, reli, score); data &score; set &FILE (keep=&score); title1; title2; title3; if &score=. then delete; run; data d1; set &score; call symput('frq',left(_n_)); data _null_; set d1; %let TPU=%eval((&frq * (&frq -1))/2); run; proc means data=&score noprint; var &score; output out=o std= s; data _null_; set o; call symput("s",s); run; data d2; set &score; reli=&reli/100; krit= 1.96 * (&s * (sqrt (2 * (1-(&reli/100))))); data d3; set d2; call symput ('krit', krit); run; proc transpose data=&score out=ot prefix=v; run; data d4; set ot; array a{*} v1-v&frq; array b{*} v1-v&frq; EPU=0; krit=abs(&krit); do i= 1 to &frq; do j= i+1 to &frq; diff=abs(a{i} - b{j}); if diff > krit then EPU=EPU+1; end; end; data fertig; set d4; TPU=&TPU; PDTS=(EPU/TPU)*100; reli=&reli/100; Personen=&frq; proc print round; var personen krit reli PDTS; title1 "Your test &file "; title2 "shows a probability to distinguishing"; title3 "two randomly selected person parameter of PDTS(in %)"; run; title1; title2; title3; run; %mend PDTS; *****************Macro PDTS END **********************; *****************Macro PDTS CALL **********************; %PDTS(file, 81, perspara)