/* expseries.sas */ title 'Experimental data with autocorrelated errors'; data test; infile '/home/u1407221/441s24/data/expseries.data.txt' firstobs=2; input time dose y; if dose=1 then d1=1; else d1=0; if dose=2 then d2=1; else d2=0; proc glm plots=none data=test; class dose; model y = dose; means dose; proc autoreg data=test; title2 'Durbin-Watson test and diagnostics'; model y = d1 d2 / dwprob; proc autoreg data=test plots=none; title2 'Test higher lags'; model y = d1 d2 / nlag=6 method=ml; proc autoreg data=test plots=none; title2 'Test for dose differences with AR(4) model'; model y = d1 d2 / nlag=4 method = ml; dose: test d1=d2=0; run; quit;