Hi,
I’m working with big data sets very often and normally every data set has several independent variables. Sometimes I need to do ANOVA and get main effects and interaction effects as well as post hoc grouping such as Duncan’s grouping for them. Regarding the output Proc GLM, I’m facing with 2 big problems: after doing analysis and getting e.g. Duncan’s grouping, the tables from GLM procedure are arranged with a combination of variables from biggest values to lowest one, and also the alphabets representing each category is in the same row with the Mean, but not the same cell. These two problems cost me to spend so much time and sometimes get frustrated to rearrange them again and put those alphabets on each mean value as superscript, appropriate for publication. I do some arrangement with Proc sort, but that is not exactly what I really need. So I would like to know:
A | 16.6 | 30 | Rapid |
A | |||
A | 16.1 | 28 | Slow |
B | 10.8 | 30 | CO_slow |
B | |||
B | 10.6 | 30 | CO_ rapid |
To this:
10.6B | 30 | CO_rapid |
10.8B | 30 | CO_slow |
16.1A | 28 | slow |
16.6A | 30 | rapid |
I would greatly appreciate any help you may give me, especially if you can write the needed program.
Thank you.
How about this? It seems similar to what you want.
How about this? It seems similar to what you want.
I'm very excited, because the table that you have created is almost the one that I want. I tried to run the program, but I got the following errors:
My SAS is 9.2, does it have anything to do with these errors?
ERROR: Cannot perform linguistic collation.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.MEANS may be incomplete. When this step was stopped there were 0
observations and 0 variables.
WARNING: Data set WORK.MEANS was not replaced because this step was stopped.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.05 seconds
cpu time 0.03 seconds
12780 data means;
12781 set means;
12782 array l
WARNING: Defining an array with zero elements.
12783 call sortc(of l
-----
716
WARNING 716-185: Argument #1 is a numeric variable, while a character variable must be passed to
the SORTC subroutine call in order for the variable to be updated.
12784 super = lowcase(cats(of l
12785 supermean = cats(vvalue(mean),catx(' ','(*ESC*){super',super,'}'));
12786 run;
NOTE: Numeric values have been converted to character values at the places given by:
(Line):(Column).
12783:18
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.MEANS may be incomplete. When this step was stopped there were 0
observations and 3 variables.
WARNING: Data set WORK.MEANS was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
cpu time 0.03 seconds
ERROR: Could not find extension: (icudt34)
ERROR: Unable to load extension: (lceicu)
12787 proc print noobs label;
12788 var supermean n level;
ERROR: Variable SUPERMEAN not found.
12789 label supermean='Mean';
12790 run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
I just tested my program with SAS 9.2 and it worked as with SAS 9.3.
Your error is actually happening before the log snippet you included.
Lets see your GLM and the rest above.
You may want to start SAS again the 12780 or so lines before may be the problem too.
Interesting...I searched SAS document and I got this : http://support.sas.com/kb/37/541.html
Apparently, my sas which is 9.2 TS1MO, has problem with using proc sort and using linguistic argument. So, I just deleted "Linguistic" word from your program and it started to work perfectly! But, I still need your expertise: 1. How can I delete the "N" column and also change the location of strain and Mean column so that strain goes to the left side? 2. How can I change those alphabets to capital ones.
Thank you very much for your help.
Look at the VAR statement in PROC PRINT.
Remove the lowcase function where I create super.
Thank you saved my time.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.