07-15-2015 01:48 AM
Assume I have a dataset with 2 variables:
1) Group - character variable, with 3 levels: Treatment 1, Treatment 2 and Control.
2) Y - Numeric variable
I wish to product a summary statistics table, with mean, standard deviation and median for all 3 categories, which is easy, using PROC TABULATE. But, I also wish to have another column at the end, with p values of a t test comparing the means of the Treatment 1 vs. Control and Treatment 2 vs. Control. In other words, the last column, will have a missing value for the first row (can't compare control to itself), and two p values in the other two rows.
I did something, I wouldn't even upload the code, it is very very long and complicated. There must be an easy way of doing it. Can you assist me with some tips on how to do it gently and efficiently ?
Thank you !
Input (numbers are arbitrary):
Requested Output (numbers are arbitrary):
|Variable||Mean||Standard Deviation||Median||P value|
07-15-2015 04:25 AM
Why not use proc means with output out=?
With regards to you requested output, I don't know what model you are using so guessing a bit. First, put:
ods trace on;
Before your model procedure and run it. This will print to the log each of the objects that are created by the model. Next, once you have highlighted the objects you want to use put:
ods output <object>=<dataset>;
This will create a dataset <dataset> with the data from <object>. Now that you have proc means output and the object output it is just a matter of merging the two together.