/* Nasalance.sas */ %include '/home/brunner0/441s20/ReadNasal.sas'; /* Variables in long3 are Participant Condition Feedback Nasalance Time Subject */ proc print data=long3(obs=190); /* Just the first 190 lines */ proc freq data=long3; tables participant feedback; proc means data=long3; class Feedback; var Nasalance; output out=meanz mean=AveNasalance; proc print data = meanz; proc sgplot data=meanz; title2 'Mean Nasalance as a Function of Feedback'; scatter x=Feedback y=AveNasalance; proc autoreg data=long3; title2 'OLS Regression with DW using proc autoreg'; model Nasalance = Feedback / dwprob; output out = longer residual = e; run; proc mixed cl data=long3; title2 'CS directly with proc mixed'; /* class Feedback; */ model Nasalance = Feedback; repeated / type=cs subject=Participant; proc mixed cl data=long3; title2 'CS random shock per subject with proc mixed'; class Participant; model Nasalance = Feedback; random Participant; /* The numbers match up PERFECTLY, except of course there is no LR chi-square. */ proc mixed cl data=long3; title2 'Just AR(1) with proc mixed'; model Nasalance = Feedback; repeated / type=ar(1) subject=Participant; proc mixed cl data=long3; title2 'Random shock from subject and AR(1) for errors'; class Participant; model Nasalance = Feedback / solution; /* Solution gives beta-hat */ random Participant; repeated / type=ar(1) subject=Participant; run; proc mixed cl data=long3; title2 'Feedback is class, Random shock from subject, AR(1) for errors'; class Participant Feedback; model Nasalance = Feedback; random Participant; repeated / type=ar(1) subject=Participant; lsmeans Feedback; run; quit;