BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
palolix
Obsidian | Level 7

Hi!

How can I get this macro in order to generate letter displays of pairwise mean comparisons in proc mixed?  Where can I downloaded?

Thanks!!

Caroline

1 ACCEPTED SOLUTION

Accepted Solutions
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

You don't need the macro anymore. Just use GLIMMIX (normal distribution is the default).

Example:

LSMEANS trt / diff lines;

or

LSMEANS A*B / diff lines;

The LINES option gives the letter display. You probably want to adjust for multiplicity if you have many treatment (factor levels). I like the simulate adjustment:

LSMEANS trt / diff lines adjust=simulate;

There are other adjustment options. If you have a factorial and you want to just do the mean comparisons within slices of the "other" factor, then you will need to use the new SLICE statement.

You can't do this directly with MIXED. But if you have SAS 9.3 or later (maybe 9.22), there is a way to store the results from MIXED and use them in the new PLM procedure for post-model fitting processing (such as means comparisons).

View solution in original post

12 REPLIES 12
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

You don't need the macro anymore. Just use GLIMMIX (normal distribution is the default).

Example:

LSMEANS trt / diff lines;

or

LSMEANS A*B / diff lines;

The LINES option gives the letter display. You probably want to adjust for multiplicity if you have many treatment (factor levels). I like the simulate adjustment:

LSMEANS trt / diff lines adjust=simulate;

There are other adjustment options. If you have a factorial and you want to just do the mean comparisons within slices of the "other" factor, then you will need to use the new SLICE statement.

You can't do this directly with MIXED. But if you have SAS 9.3 or later (maybe 9.22), there is a way to store the results from MIXED and use them in the new PLM procedure for post-model fitting processing (such as means comparisons).

palolix
Obsidian | Level 7

Thank you very much for your help!

When using glimmix I will certainly use this option, but when using proc mixed, which code should I use to store the results and analysing the pairwise comparisons with proc PLM?

Thank you!

Caroline

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

Just a follow up to my previous email. If you have two factors, for instance, you can use:

proc glimmix data=sim;

class block A B;

model y = A|B;

random block;

lsmeans A*B / lines;

slice A*B / sliceby=B lines; *--get comparisons of A for each B level;

run;

The LSMEANS A*B statement is doing all possible mean comparisons for the interaction of A and B (which likely includes many comparisons that are not of interest). THe LINES options is giving the letter display. If you have 6 levels of A and 3 of B, the A*B table has 18 means for comparisons. Note that the SLICE statement is testing for the A effect at each level of B. There will be an F test for A at B=1, another F test for A at B=2, and so on. The LINES option on SLICE is giving you the multiple mean comparisons for all the A levels at B=1, then at B=2, and so on.

If you really must use MIXED, then the following will be needed:

proc mixed data=sim;

class block A B;

model y = A|B;

random block;

lsmeans A*B;

store sasuser.MCP1;

run;

proc PLM restore=sasuser.MCP1;

lsmeans A*B / lines;

slice A*B / sliceby=B lines; *--get comparisons of A for each B level;

run;

I used the new item store (STORE ....) in MIXED, and then followed this with the PLM procedure to do the letter (line) display of means and the slices of B. You can't do either directly in MIXED.  For your information, the stored sasuser.MCP1 file is now permanently on your computer, which means you could in a future go right to the PLM step and not use MIXED at all (unless the data or model changes).

palolix
Obsidian | Level 7

Thanks a lot the codes!!

Is it mandatory to store your model in sasuser or you can also store it somewhere else?

Thank you!

Caroline

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

I am sure you have many choices for location of the so-called item store. Check the documentation. Here is a nice article on the many uses of PLM.

http://support.sas.com/resources/papers/proceedings10/258-2010.pdf

palolix
Obsidian | Level 7

Thanks a lot for your help!  I will read this document.

Caroline

Ghimire
Calcite | Level 5

Hi there,

 

I often use SAS Macro PDMIX800 for mean comparison/grouping along with SAS Proc Mixed. I used this 'Proc Glimmix' to do the same. However, I am confused for one thing. When I compared both of results, I found that Glimmix  result is similar to Proc Mixed assuming equal variance. However, the addition of "repeated statement' for modeling the variance in the case of the unequal variance in Proc Mixed gives a different result. I tried to add the same repeated statement in Proc Glimmix but could not. So, I am wondering if this result of mean separation from Proc Glimmix in a case of a dataset with unequal variance is acceptable or there is any other way to model the variance to obtain same results from PDMIX800 and Proc Gliimmix.

 

Bikash

SteveDenham
Jade | Level 19

GLIMMIX implements repeated measurements differently than MIXED, by adding a RESIDUAL option to the RANDOM statement.

 

Steve Denham

Ghimire
Calcite | Level 5

Hi Steve,

 

Thank you very much for your response. So, If Glimmix performs the measurement differently than Proc Mix, is that both of the results are valid/true as per their own way of computation?

 

Bikash

Carina001
Calcite | Level 5

Thanks, I tried it and it worked. However it does not seem to incorporate the Tukey adjusment. Is there a way around this?

KTstarter
Calcite | Level 5

How would this work for SAS Studio when it's used through a Virtual box installation and using prox mixed? 

C_jerke
Calcite | Level 5

Hello KTStarter,

 

I'm using Virtual box as well, and I'm trying to figure out how to use this PDMIX800 through this tool. Could you solve this question?

 

I need to transform my LINE results from Tukey test in LETTERS to distinguish different groups. My data is too big to do it manualy 😞

 

Waiting some help.

 

Carol.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 12 replies
  • 10592 views
  • 5 likes
  • 7 in conversation