통계 clinical trial/SAS

TTEST using proc mixed

고향이안드로메다 2018. 11. 30. 16:00
Paired t-test
data pressure;
         input SBPbefore SBPafter @@;
         datalines;
   120 128   124 131   130 131   118 127
   140 132   128 125   140 141   135 137
   126 118   130 132   126 129   127 135
   ;
   run;


ods graphics on; proc ttest; paired SBPbefore*SBPafter; run;

ods graphics off;


Paired t-test using PROC MIXED procedure

ref-1

proc mixed method=type3; 

 class pt paired; 

 model y = paired / ddfm=kenwardroger; 

 random pt; 

 lsmean paired / tdiff cl; 

run; 



data conc2a conc2b; set conc2 ;

if (order1 = 2 or order1 =3) ;

if trt = "R" then output conc2a;

if trt = "T" then output conc2b ;


run ;


%macro ttest(aaa);

 proc mixed data = conc2&aaa method=type3;

 class subject  order1 ;

 model conc  = order1 / ddfm=kenwardroger; 

random subject  ;

 lsmean order1/ tdiff cl; 

run; 


%mend ;

%ttest(a);

%ttest(b);

 

Unpaired t-test

proc ttest data = mainlib.file1; var _numeric_; class buy_ind; run;