PROC TTEST for Paired T-test

data exercise; input Subject_ID $ Posttest Treatment $; cards; A 24 T B 26 C C 25 T D 44 C E 45 T F 24 C G 25 T ; run;

PROC TTEST; class treatment; var Posttest; RUN;

PROC TTEST and created a result dataset

/*Ttest Macro*/

/*Creates a result sad data set t_test_results*/ /*Find it in a temp folder and click-open it as an excel file*/

%let dataname=sashelp.class; %let varlist=weight height age; %let group=sex;

proc ttest data=&dataname; class &group; var &varlist ; ods output statistics=kaz1 ttests=kaz2 equality=kaz3; run;

data kaz3b; set kaz3; if ProbF < 0.05 then unequal=1; […]