* 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 * %PDPP(FILE, PERSPARA, SEM); * Compute the PDPP; * 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; %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 *****************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 PDPP BEGIN **********************; %macro PDPP(file, PERSPARA, SEM); * The data file is reduced to the person parameter pp and transposed; data macro.p1; set &file(keep=&PERSPARA ); run; * the number of observations = number subject is read; %content2(p1,3) proc transpose data=macro.p1 out=macro.pg1 prefix=p; run; data macro.pg2; set macro.pg1(drop=_NAME_); * next the data file is reduced to the standard error of the person parameter and also transposed; data macro.e1; set &file(keep=&SEM ); proc transpose data=macro.e1 out=macro.eg1 prefix=e; run; data macro.eg2; set macro.eg1(drop=_NAME_); * both files are next connected; * and the arrays are defined to allow a very quick computing; data macro.pe; merge macro.pg2 macro.eg2; array a{*} p1-p&obs; array b{*} p1-p&obs; array c{*} e1-e&obs; array d{*} e1-e&obs; * EPU is the number of statistical distinct pairs; * TPU is the number of all pairs; EPU=0; TPU=0; * the distance between a pair is next compared to the LSD least signficant differences in a very long file; do i= 1 to &obs; do j= i+1 to &obs; ppk=1.96*sqrt(c{i} + d{j}); ppd= abs(a{i} - b{j}); * Counting significant pairs; if ppd > ppk then EPU=EPU+1; TPU=TPU+1; end; end; data raus; set macro.pe(drop=p1-p&obs e1-e&obs); call symput('EPU', EPU); call symput('TPU', TPU); data IRTPDR; set macro.pe; Scale="&file"; PDPP=( &EPU/ &TPU )*100; Personen=&obs; proc print round; var scale personen PDPP; title1 "Your test &file "; title2 "shows a probability to distinguishing two randomly"; title3 "selected person parameter of ... (see PDPP in %)"; run; title1; title2; title3; run; %mend PDPP; *****************Macro PDPP END **********************; *****************Macro PDPP CALL **********************; %PDPP(file, PERSPARA, SEM)