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

Hello, using the PROC GLIMMIX - LSMEANS I would like to get the differences between the groups (A, B, C and D) for each time (1, 2, 3 and 4).

 

Exemple:

  

Only for Time = 1

 

Tukey-Kramer Grouping for Grupo Least
Squares Means (Alpha=0.05)

LS-means with the same letter are not
significantly different.

Grupo

Estimate

 

Grupo D

1.8

A

 

  

Grupo B

1.7

B

 

 

B

Grupo A

1.7

B

 

 

B

Grupo C

1.6

B

 

 

 Only for time 2:

 

Tukey-Kramer Grouping for Grupo Least
Squares Means (Alpha=0.05)

LS-means with the same letter are not
significantly different.

Grupo

Estimate

 

Grupo B

1.9

A

 

  

Grupo C

1.5

B

 

 

B

Grupo D

1.3

B

 

 

B

Grupo A

1.0

B

 

Only for time 3 ...

The same idea...

 

Only for time 4 ...

The same idea...

 

 

My line commands were showed below:

  

PROC GLIMMIX DATA=WORK.Example;
	CLASS ID Group Time;
	MODEL var_study = Group Time Group*Time / DDFM=KR DIST=GAUSSIAN;
	RANDOM Time / RESIDUAL TYPE=CS SUBJECT = ID;
	LSMEANS Time*Group / LINES ADJUST=TUKEY;
RUN;
QUIT;

/* Dosen´t work the sintaxe = Lsmeans Group*Time / Slice=Time adjust=tukey;

 

 

So, in order to get the differences between the groups (A, B, C and D) for each time (1, 2, 3 and 4), how do I construct the LSMEANS procedure?

 

Thanks a lot,

Mingoti, Rodolfo.

1 ACCEPTED SOLUTION

Accepted Solutions
Rodolfo_Mingoti
Fluorite | Level 6

Thanks a lot StatsMan!

 

I used your suggestion and got the results you needed.
Problem solved!

 

The final sintaxe was:

 

PROC GLIMMIX DATA=WORK.Example;
	CLASS id Group Time;
	MODEL var_study = Group Time Group*Time / DDFM=KR DIST=GAUSSIAN;
	RANDOM Time / RESIDUAL TYPE=CS SUBJECT = id;
		
SLICE Group*Time / SLICEBY=Time LINES ADJDFE=ROW ADJUST=TUKEY PLOT=NONE ;

RUN;
QUIT;

View solution in original post

2 REPLIES 2
StatsMan
SAS Super FREQ

Take a look at the SLICE statement in the PROC GLIMMIX documentation.  The syntax 

 

slice group*time / sliceby=time lines;

 

should give you what you are looking for.  In earlier releases of SAS, you will get the letters next to the lsmeans, indicating significance in the comparisons of the adjusted means.  In the latest release, you will get an ODS graphic that shows the significance across the comparisons.  These comparisons will be done within each level of the SLICEBY effect.  Add ADJUST=TUKEY if you want to get adjusted p-values within each level of the SLICEBY effect.  

Rodolfo_Mingoti
Fluorite | Level 6

Thanks a lot StatsMan!

 

I used your suggestion and got the results you needed.
Problem solved!

 

The final sintaxe was:

 

PROC GLIMMIX DATA=WORK.Example;
	CLASS id Group Time;
	MODEL var_study = Group Time Group*Time / DDFM=KR DIST=GAUSSIAN;
	RANDOM Time / RESIDUAL TYPE=CS SUBJECT = id;
		
SLICE Group*Time / SLICEBY=Time LINES ADJDFE=ROW ADJUST=TUKEY PLOT=NONE ;

RUN;
QUIT;

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 911 views
  • 2 likes
  • 2 in conversation