Hello ballardw, Thank you for your detailed response and for telling me about the </> icon. I have two datasets Pr_table5 (test) and C_table5 (control). Each table consists of CD3 tested on different time intervals (day 0 day3 day7 day14 day30) with different n on each day. For example, day0 N is 63, and day30 N is 50 I have to calculate a t-test comparing Pr_table5 and C_table5. The final table should look like this:- T-Tests Variable Method Variances DF t Value Pr > |t| mean Pooled Equal XX XX XX mean Satterthwaite Unequal XX XX XX So I calculated the mean for Pr_table5 (mean of day0, mean of day3...) and c_table5 (mean of day0, mean of day3...) and dropped n min max std so that it will have only mean from table1 and table 2. proc means data = Pr_table5 noprint;
output out = a(drop = _type_ _freq_ );
run;
proc transpose data = a out = a (drop = n min max std ) ;
id _STAT_;
run;
proc means data = c_table5 noprint;
output out = b(drop = _type_ _freq_ );
run;
proc transpose data = b out = b (drop = n min max std ) ;
id _STAT_;
run; Then I merged two tables (combo) which contain means from two tables. data combo_a;
set a ;
_name_ = 'mean_a';
run;
data combo_b;
set b ;
_name_ = 'mean_b';
run;
data combo;
set combo_a combo_b;
run;
Next, I did a t-test proc means data=combo noprint;
var mean;
by _name_;
output out=new_combo;
run;
proc ttest data=new_combo nobyvar;
class _name_;
var mean;
run; Please let me know if there is a better approach, from both a statistical and programming point of view. Thank you, Madhu
... View more