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

What is the best way to obtain adjusted means from a Proc GLM model (file attached) such as:

proc glm data=invivo;

      class block treatment;

      model invivo=block treatment;

weight treatment;

      lsmeans treatment/ ADJUST=TUKEY;

Contrast 'Compare stx1-0hr with stx2-0hr' treatment 1 0 0 0 -1 0 0 0 0;

Contrast 'Compare stx1-1hr with stx2-1hr' treatment 0 1 0 0 0 -1 0 0 0;

Contrast 'Compare stx1-2hr with stx2-2hr' treatment 0 0 1 0 0 0 -1 0 0;

Contrast 'Compare stx1-3hr with stx2-3hr' treatment 0 0 0 1 0 0 0 -1 0;

   run;

The block effect is highly significant but I am having trouble identifying a method to report the adjusted means which accounts for the significant block effect.  Does this require the ESTIMATE function?

Any suggestions?

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

The best way is to analyze the data using PROC MIXED or PROC GLIMMIX, and consider block as a random effect.  In this case, standard errors of the treatment means will correctly incorporate the variance due to block.  I also notice in your contrasts that there is a time factor.  If the time reflects repeated measurements on the same experimental unit, then the analysis should also incorporate that. Until that is clear, consider the following:

proc glimmix data=invivo;

class block treatment;

model invivo=treatment;

random block;

lsmeans treatment;

LSMESTIMATE treatment

'Compare stx1-0hr with stx2-0hr'  1 0 0 0 -1 0 0 0 0,

'Compare stx1-1hr with stx2-1hr'  0 1 0 0 0 -1 0 0 0,

'Compare stx1-2hr with stx2-2hr'  0 0 1 0 0 0 -1 0 0,

'Compare stx1-3hr with stx2-3hr'  0 0 0 1 0 0 0 -1 0/adjust=simulate(seed=1);

/*Tukey adjustment is not available for the LSMESTIMATE as it is not defined */

run;

Steve Denham


View solution in original post

2 REPLIES 2
SteveDenham
Jade | Level 19

The best way is to analyze the data using PROC MIXED or PROC GLIMMIX, and consider block as a random effect.  In this case, standard errors of the treatment means will correctly incorporate the variance due to block.  I also notice in your contrasts that there is a time factor.  If the time reflects repeated measurements on the same experimental unit, then the analysis should also incorporate that. Until that is clear, consider the following:

proc glimmix data=invivo;

class block treatment;

model invivo=treatment;

random block;

lsmeans treatment;

LSMESTIMATE treatment

'Compare stx1-0hr with stx2-0hr'  1 0 0 0 -1 0 0 0 0,

'Compare stx1-1hr with stx2-1hr'  0 1 0 0 0 -1 0 0 0,

'Compare stx1-2hr with stx2-2hr'  0 0 1 0 0 0 -1 0 0,

'Compare stx1-3hr with stx2-3hr'  0 0 0 1 0 0 0 -1 0/adjust=simulate(seed=1);

/*Tukey adjustment is not available for the LSMESTIMATE as it is not defined */

run;

Steve Denham


mclaughj
Calcite | Level 5

Many thanks Steve.  I appreciate your time and expertise.

Sincerely,

John

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
  • 2 replies
  • 1403 views
  • 0 likes
  • 2 in conversation