options ls=75; data one; input before after; subject=_n_; diff=after-before; cards; 12.3 12 12 12.3 12 12.5 13 12 13 13 12.5 12.5 11.3 10.3 11.8 11.3 11.5 11.5 11 11.5 11 11 11.3 11.5 ; proc ttest; title "Good ole paired ttest"; paired before*after; run; /* reconfigured data, one observation per 1 msmt, total of 2x12=24 */ data ftest; set one; keep subject time period; array times{2} before after; array timename{2} $ ("before","after"); do i = 1 to 2; time=times{i}; period=timename{i}; output; end; run; proc glm; title "proc glm to fit model for rcbd"; class period subject; *model y=period subject; model time=period subject; /* y changed to time (typo) */ run; proc mixed; title "proc mixed to fit model for rcbd, subjects random"; class subject period; model time=period; random subject; lsmeans period/diffs; run;