BookmarkSubscribeRSS Feed
FiveTenMatt
Calcite | Level 5

I've finally gotten around to finishing up this project and thanks to the earlier help everyone here provided, I feel like I'm good to go. I have a few follow-up questions. Remember, I'm fairly out of my league here both in terms of my understanding of mixed models as well as my comprehension of means models.

  1. Since some of my treatment groups are missing days entirely, can I safely assume there will always be a "treatment x Day" interaction? I'm worried about the case in which there is a main effect of one or the other, but no interaction. I can't see obvious way to report a main effect using this method.
  2. Do I need to correct for multiple comparisons of all my lsestimates statements? I'm used to an ANOVA setting, where the DFs used by my posthocs are encumbered in the model itself, so no correction of posthocs is necessary. It looks like proc glimmix is using t-tests, so that would suggest I need to correct for multiple comparisons. Thoughts?
  3. How do I go about reporting these results in a manuscript? I'm used to reporting the fixed effects followed by the posthocs; in a means model should I be reporting the "Treatment*Day" F? What about in the case of #1 above, where there is no interaction, but there is a main effect? How do I report this?

Thanks for the help! You guys are the best!

SteveDenham
Jade | Level 19

1.  When fitting a means model, don't think of treatment * day as an interaction.  Think of it as a shortcut in notation for a one-way analysis.  If it is not "significant", then I would feel very uncomfortable constructing main effects.  A main effect is then "defined" as contrasts/estimates/lsmestimates between one set of LSmeans and a second set. For the LSMESTIMATE statement, this would mean invoking the JOINT option to get a joint F test that accommodates the multiple parts of the statement.

2.  I correct for multiple comparisons, as these are post-hoc comparisons.  So aside from the JOINT option, you should use ADJUST= <pick your method of choice, I happen to like SIMULATE> and ADJDFE=ROW.

3.  Report the overall F, and any of the F tests from the JOINT option that tests main effect and interaction LSMESTIMATES.  Specific comparisons (post-hocs, in your terminology) would then be reported with the adjusted P values.

Steve Denham

FiveTenMatt
Calcite | Level 5

Steve,

Thanks again for the help, but I'm still running into some issues. It looks like Proc glimmix doesn't include a joint option for lsmestimate statements. It does provide an FTEST option. Should I be using this? I've been scouring the web all morning for examples of how to use this with my code, and have totally drawn a blank. I've copied a bit of what have below:

proc glimmix data=in;

     class mouse treatment day;

     model score = treatment*day;

     random day / subject=Mouse group=treatment;

     lsmestimate treatment*day 'treatment1 vs treatment2'

          .125 .125 .125 .125 .125 .125 .125 .125

          -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071

          0 0 0 0 0 0 0 0 0 0 0 0 0 0

          0 0 0 0 0 0 0 0 0 0 0 0 0 0

          0 0 0 0 0 0 0 0 0 0 0 0 0 0,

     lsmestimate treatment*day 'treatment1 vs treatment3'

          .125 .125 .125 .125 .125 .125 .125 .125

          0 0 0 0 0 0 0 0 0 0 0 0 0 0

          -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071

          0 0 0 0 0 0 0 0 0 0 0 0 0 0

          0 0 0 0 0 0 0 0 0 0 0 0 0 0;

run;

I have a few more lsmestimate statements included in the full code, but they pretty much follow the examples I provided. Note, Group 1 only has 8 'days', while the other groups have 14, hence the differential weighting. I'm also correcting for multiple comparisons as you suggested, but using proc multtest in a separate step.

So, given what I've provided, how would the FTEST option (if that's correct) fit into my LSMESTIMATE statements as written? Do I need a new LSMESTIMATE statement that will use the FTEST option? If so, how do I weight the individual cells to give me appropriate weights. I'm used to one cell being positive and the other negative, but that doesn't seem right in the case of the FTEST/JOINT option.

Sorry to belabor the issues I'm having, but I simply can't find useful examples of this online, and thus have to resort back to the forum for help. Thanks.

SteveDenham
Jade | Level 19

You have several LSMESTIMATE statements, separated by commas, which is going to be troublesome.  I have copied the above code and changed it as needed:

proc glimmix data=in;

     class mouse treatment day;

     model score = treatment*day;

     random day / subject=Mouse group=treatment;

     lsmestimate treatment*day 'treatment1 vs treatment2'

          .125 .125 .125 .125 .125 .125 .125 .125

          -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071

          0 0 0 0 0 0 0 0 0 0 0 0 0 0

          0 0 0 0 0 0 0 0 0 0 0 0 0 0

          0 0 0 0 0 0 0 0 0 0 0 0 0 0,

'treatment1 vs treatment3'

          .125 .125 .125 .125 .125 .125 .125 .125

          0 0 0 0 0 0 0 0 0 0 0 0 0 0

          -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071 -.071

          0 0 0 0 0 0 0 0 0 0 0 0 0 0

          0 0 0 0 0 0 0 0 0 0 0 0 0 0/FTEST;

run;


Note that "lsmestimate treatment*day" appears only once at the start of the block, the labels identify each section, and that finally the FTEST option is added after a forward slash at the end of the last of the comparisons in the block.  In this case, it will give a joint F-test for 1 v 2 and 2 v 3, which would look to me like a 2 nuerator degree of freedom F test equivalent to the null of t1=t2=t3.

Steve Denham

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

You need to use the solution option:

model Running= Treatment*Day / solution ;

This will show you the parameters being estimated, and the order.

Education
Obsidian | Level 7

Hi Sorry for bringing this into an old post, but i have read the previous explanation and grab some insight on the mean model. At the moment i am struggling with defining the LSMESTIMATE statement. Below is my syntax:

 

 

PROC GLIMMIX DATA=dataa;

CLASS SEASON DAYS AGE ANIMAL_ID;

MODEL RESPONSE= SEASON*DAYS*AGE/ SOLUTION DDFM=RES;

RANDOM ANIMAL_ID; RUN; QUIT;

 

I am not so sure how to define it especially from the model with 3 fixed factors.

 

LSMESTIMATE SEASON*DAYS*AGE ?? I also attached my data set if maybe i am missing something out.

 

Help please. Regards, Education

sas-innovate-2024.png

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.

 

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
  • 20 replies
  • 4872 views
  • 6 likes
  • 4 in conversation