Hello, I am trying to do some two sample t tests with proc tabulate.
Is it even possible to do a two sample T-test with proc tabulate.
I have ran the ttest with proc ttest, and gotten the results I want. My issue is the output is difficult for my teammate to understand. I was trying to simplify it with proc tabulate.
proc ttest data = work.t_test alpha=.05;
class ax_mcell_email_ibs_pm933;
var ct_bert1_score ;
run;
This is my ttest sas code. This is working and give this output:
This is the code I have for proc tabulate. It is very close to what I want but appears to complete a 1 sample t test instead of a two sample ttest.
proc tabulate data = work.t_test;
class ax_mcell_email_ibs_pm745; /*Update current Program*/
var ct_bert1_score;
table (ax_mcell_email_ibs_pm745='M_CELL'), ct_bert1_score * (n mean stddev t prt);
run;
The following is what I want the output to look like, I took the output from proc tabulate and edited it with a text editor.
In PROC TABULATE, the T and PRT are for the hypothesis that the mean is zero. They do not give you the ability to test the hypothesis that the two means are equal to each other (you may be able to program this yourself in TABULATE, but why bother when PROC TTEST does it for you?)
Personally, I have no issue with Proc ttest. My team is trying to automate some processes/ reports. The ttest procedure is apparently difficult for those with no statistics background to understand. Is there a way to get something similar to the output I want? I have tried ods output, proc format and just can't seem to get it. In words, I just want the output to have the N, mean, std. dev. t statistic, p-value, and a pass/fail indicator.
If you store the output from PROC TTEST in a SAS data set, you should be able to get PROC TABULATE or PROC REPORT or even a DATA step to produce the desired table.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.