Programming the statistical procedures from SAS

how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

Accepted Solution Solved
Reply
Contributor
Posts: 72
Accepted Solution

how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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


Accepted Solutions
Solution
‎03-20-2013 03:55 PM
Valued Guide
Valued Guide
Posts: 673

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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


All Replies
Solution
‎03-20-2013 03:55 PM
Valued Guide
Valued Guide
Posts: 673

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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).

Contributor
Posts: 72

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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

Valued Guide
Valued Guide
Posts: 673

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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).

Contributor
Posts: 72

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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

Valued Guide
Valued Guide
Posts: 673

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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

Contributor
Posts: 72

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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

Caroline

New Contributor
Posts: 2

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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

Respected Advisor
Posts: 2,655

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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

 

Steve Denham

New Contributor
Posts: 2

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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

New Contributor
Posts: 2

Re: how to get pdmix800.sas for letter displays of pairwise mean comparisons in proc mixed?

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 10 replies
  • 2838 views
  • 2 likes
  • 5 in conversation