* modify this; %let path=C:\files; * assign SAS library; libname data "&path\data"; * include the SAS macro; %include "&path\sas\macro\lrasch_mml.sas"; /* marginal item distribution */ proc freq data=data.scqol; table b_sc01-b_sc09 fu_SC01-fu_SC09 / nocum; run; /* specify variable names and response formats (item SC01 at baseline and items SC03 and SC06 at follow-up considered to have only three response options) */ data inames; input item_no item_names1 $ item_names2 $ item_text $ max1 max2; datalines; 1 b_SC01 fu_SC01 SC01 2 3 2 b_SC02 fu_SC02 SC02 3 3 3 b_SC03 fu_SC03 SC03 3 2 4 b_SC04 fu_SC04 SC04 3 3 5 b_SC05 fu_SC05 SC05 3 3 6 b_SC06 fu_SC06 SC06 3 2 7 b_SC07 fu_SC07 SC07 3 3 8 b_SC08 fu_SC08 SC08 3 3 9 b_SC09 fu_SC09 SC09 3 3 ; run; *%include 'P:\public_html\macro\lrasch_mml.sas'; FILENAME lrasch URL 'http://biostat.ku.dk/~kach/macro/lrasch_mml.sas'; %include lrasch; /* fit the longitudinal Rasch model - plot ICC's */ %lrasch_mml(DATA=data.scqol, ITEM_NAMES=inames, ANCHOR=b_SC02 b_SC04 b_SC05 b_SC07 b_SC08 b_SC09, SPLIT=NONE, OUT=scqol, ICC=YES); /* fit longitudinal Rasch model - allow item parameter drift for item SC02 */ %lrasch_mml(DATA=data.scqol, ITEM_NAMES=inames, ANCHOR=b_SC04 b_SC05 b_SC07 b_SC08 b_SC09, SPLIT=NONE, OUT=AN2); /* compare the two models using a likelihood ratio test */ data lrt; merge SCQOL_logl(rename=(value=logl_0)) AN2_logl(rename=(value=logl)); where Descr='-2 Log Likelihood'; lrt=logl_0-logl; df=3; p=1-probchi(lrt,df); run; proc print noobs; run; /* fit longitudinal Rasch model - allow for lacal dependence across time points */ %lrasch_mml(DATA=data.scqol, ITEM_NAMES=inames, ANCHOR=b_SC02 b_SC04 b_SC05 b_SC07 b_SC08 b_SC09, SPLIT=b_SC02, OUT=SP2); /* compare the two models using a likelihood ratio test */ data lrt; merge SCQOL_logl(rename=(value=logl_0)) SP2_logl(rename=(value=logl)); where Descr='-2 Log Likelihood'; lrt=logl_0-logl; df=12; p=1-probchi(lrt,df); run; proc print noobs; run; ods pdf file='c:\dropbox\jss.pdf'; %lrasch_mml(DATA=data.scqol, ITEM_NAMES=inames, ANCHOR=b_SC02 b_SC04 b_SC05 b_SC07 b_SC08 b_SC09, SPLIT=NONE, OUT=scqol, ICC=YES); ods pdf close;