Hi, all. I'm fairly new to SAS (using version 9.4), as a colleague kindly showed me how to run some analyses I was requested to do on revisions for a manuscript that I was unable to do in SPSS / Mplus. I am seeing if there are any differences among 3 groups of users of different drugs (let's call them X, Y, and Z) on a measure of Attention. Each participant was seen once yearly for 4 years and therefore has 4 scores on attention. The data are in long-form with each time-point coded as "timept", and time was treated as a continuous variable. Predictors in the model include age, sex, and years of education. I included effects of time ("timept"), drug group ("grp"), and a time x group interaction in the model, and clustered participants by hospital to account for prescribing practices. Is there a way to plot results of this analysis with each group (X, Y, and Z) on their separate lines, with time on the x-axis and attention scores on the y-axis? I've Googled around trying to figure this out, but have been having trouble finding code to adapt which has clustered participants as I have done - though perhaps I have not looked in the right place. Any help or advice on how else to best present these findings would be much appreciated. The time x group interaction is significant - users of drug Y showed worse attention over time than users of drugs X and Z. Thanks! Here is the code I have been using: ods listing;
run;
libname data 'C:\Users\kateiverson\Downloads\';
run;
ods graphics on;
*Importing data;
proc import datafile="C:\Users\kateiverson\Downloads\11-25-16.csv"
out=final
dbms=csv
replace;
run;
*Attention;
proc mixed data=final plots=all covtest noclprint cl nobound;
class hospital subjectID grp(ref="3");
model attention=age sex edu timept grp timept*grp / solution cl;
random intercept timept / subject=hospital;
random intercept timept / subject=subjectID(hospital);
run;
... View more