Hi Everyone,
I was just wondering whether there is a way to display letters on multiple comparison in SAS while having triple interaction in the model.
Suppose this is the model:
Y=A+B+C+A*B*C
A, B, and C each with 4 levels; therfore, there will be 64 mean comparisons.
Using LINES and SLICE statment is not working properly.
I would appreciate any suggestion
Sharam
Many statisticians would argue that you should not do all three-way comparisons, but limit comparisons to slices within other factors when there are interactions. If you really need to do the 3-way comparisons, then create a three-way variable in a data step (where each level represents a unique combination of the three factors), and do the anova using just this variable (I am assuming that this high level interaction is significant). Then you will not have any trouble getting the results in %mult.
"Not working properly" is awful vague.
Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.
No output? Post any log in a code box.
Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.
Thanks for your reply.
Yes, I should have explained it better.
I'm using SAS 9.4 version. There is no error in Log page. However, in the output when the mean comparisons is done at the end of the table I'm seeing this:
My data set is attached here, and the command line that I used is as below:
PROC glm data=trial;
CLASS Group Dose AA ;
MODEL First Second Total = Group Dose AA Group*Dose*AA / ss3;
lsmeans Group*Dose*AA / lines pdiff tdiff stderr adjust=tukey;;
RUN;
The program is working properly. You get the message because your lsmeans (or really their differences) have very unequal standard errors. That means that two means that are far apart might be not significantly different, but two means closer together (inside the extremes) might actually be signficantly different. This messes up the lines display. GLIMMIX/PLM takes a conservative approach for the lines, and then gives the warning message about the additional differences. The only way I know of getting all comparisons on the same table is to use Piepho's algorithm, which requires that you run a sas macro that he wrote (using stored lsmeans and mean differences). See the following links. But note: you will get a messy output, potentially, since some close means will show differences, but means farther apart will show no difference.
See:
http://agrobiol.sggw.waw.pl/~cbcs/articles/CBCS_7_1_2.pdf
http://www.akt.tu-berlin.de/fileadmin/fg34/publications-akt/letter-displays-csda06.pdf
http://amstat.tandfonline.com/doi/citedby/10.1198/1061860043515
I just realized that you are using GLM; I highly recommend that you use GLIMMIX. Your unequal "standard errors" are due to Tukey method. I recommend that you use method=simulate in GLIMMIX.
Ivm,
Thanks for your reply!
I have already tried %MULT macro sugested by Piepho (2012). It is a good one. However, it give comparisons only between two factors using 'by' statement. That means you can not have all the comparisons at the same time. For example in the case of my data, I have 3 factors (A with 2 levels, B with 2 levels, and C with 9 levels) which I need to compare 36 (2x2x9) means simultaneously, but %MULT macro give sort of comparison like comparing 9 levels of C in only one level of the other factors. Such comparison can also be easily done by just changing the data structure and using GLM including 'lines'. Therefore, I'm reaching this conclusion that probably I cannot have all the comparisons altogether at one table using SAS, unless there is a way that I'm not aware of.
Thank you again for your help.
Many statisticians would argue that you should not do all three-way comparisons, but limit comparisons to slices within other factors when there are interactions. If you really need to do the 3-way comparisons, then create a three-way variable in a data step (where each level represents a unique combination of the three factors), and do the anova using just this variable (I am assuming that this high level interaction is significant). Then you will not have any trouble getting the results in %mult.
Thanks so much for your support!
Yes, I think at the end I should combine my three fixed effects together as if I have only one fix effect to make the model simpler.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.