Hi Everyone,
I would like to check some of my understandings with Proc Glimmix.
In summary, I have 20 animals split in 2 groups (treated and control = TRT effect (0 or 1) and I measured the concentration of moleculeX (continuous variable) in different location in the gut (colon, jejunum, ileum...=Location effect)
My questions are the following:
Does the treatment impact the overall concentration of moleculeX?
Is the impact of treatment different between locations?
I used the following code:
proc glimmix data=IgADMgut;
CLASS Animal TRT Location;
MODEL MoleculeX= TRT Location TRT*Location / ddfm=kr solution;
random _residual_ / subject = Animal(TRT) type=cs;
lsmeans TRT Location TRT*Location / cl slicediff=Location pdiff=all diff lines adjust=simulate adjust=bon plot=meanplot (join sliceby=TRT);
run;
Could you first verify that my code is correct?
Then I have a question concerning the outputs.
I have a significant interaction of TRT*Location; meaning that the effect of TRT depends on the Location.
Type III Tests of Fixed Effects | ||||
Effect | Num DF | Den DF | F Value | Pr > F |
TRT | 1 | 18 | 41.18 | <.0001 |
Location | 2 | 36 | 103.48 | <.0001 |
TRT*Location | 2 | 36 | 12.12 | <.0001 |
Then, can I look at the LSmeans of simple effect of TRT*Location and the AdjustPvalues state about the effect of TRT for each location? (here only significant in ileum and colon)
Simple Effect Comparisons of TRT*Location Least Squares Means By Location | |||||||||||||
Simple Effect Level | TRT | TRT | Estimate | Standard | DF | t Value | Pr > |t| | Adj P | Alpha | Lower | Upper | Adj Lower | Adj Upper |
Location Colon | 0 | 1 | -0.8560 | 0.1403 | 53.44 | -6.10 | <.0001 | <.0001 | 0.05 | -1.1373 | -0.5746 | -1.1408 | -0.5712 |
Location Jejunum | 0 | 1 | -0.01370 | 0.1403 | 53.44 | -0.10 | 0.9226 | 0.9230 | 0.05 | -0.2951 | 0.2677 | -0.2922 | 0.2648 |
Location Ileum | 0 | 1 | -0.7986 | 0.1403 | 53.44 | -5.69 | <.0001 | <.0001 | 0.05 | -1.0799 | -0.5172 | -1.0861 | -0.5110 |
I do not get why the SE in this table is always the same? Where and how can I get the correct SE for each treatment by location ?
Many thanks in advance for your help,
Nicheca
I think that it should be "subject=Animal".
You have locations nested within each animal. So, the measurements within each animal are going to be correlated. I don't think that subject=Animal(TRT) is correct, but it may not make a difference depending how you coded the variables.
You specify type=cs which mean a compound symmetric correlation structure. That is, you are assuming the same correlation between all of the locations. That's probably giving you equal SEs. You could try type=un which will estimate different correlations for all pairs of locations.
Hi!
Thank you for you reply. I coded with 3 different columns: Animal (1-20), Location (Ileum, Colon and Jejunum) and TRT (0 or 1). Then, should I still not used 'Animal(TRT)' ? Does SAS recognize automatically that is the same Animal collected in each Location?
Thank you for the covariance structure! I missed it.
Nicheca
I think that it should just be "subject=Animal". Probably won't make a difference though.
This line is telling GLIMMIX that you have repeated measures within each animal. it will estimate the correlation matrix between locations.
Make sure the data is sorted by animal id then location.
@Nicheca, If ANIMAL is coded 1 to 20 within each TRT level, then you must use subject=ANIMAL(TRT) so that GLIMMIX can recognize 40 animals rather than 20. If ANIMAL is coded 1 to 40, then you could use either subject=ANIMAL or subject=ANIMAL(TRT) but the second syntax will generally do a better job at estimating denominator df, in my experience.
I prefer this syntax; I am remembering that it's safer to use in case you do not have all locations for all subjects or the data set is not sorted by location within subject (but I can't find a reference for that quickly).
random location / subject = Animal(TRT) type=cs residual;
TYPE=CS is a homogeneous variances structure (as well as homogeneous covariances/correlations, as noted by @cminard ) so if you have a balanced design you will get the same SE for all estimates of a similar type (for example, pairwise comparisons among locations). You could try other covariance structures that allow heterogeneous variances (for example, heterogeneous compound symmetry CSH or UN) and see whether any provide a better fit to the data, and you could do graphical assessment of residuals to see whether those indicated heterogeneous variances among locations (I use boxplots).
I hope this helps.
Many thanks to @cminard & @sld
Actually my animals are coded from 1 to 20 but animal #1 is always TRT and #2 is always CON; #3 = TRT and so one... So it is an unique ID for animal and they are either CON or TRT. I should then be ok with 'subject = Animal' even if I can also mention 'subject = Animal(TRT)' - results are similar. Thanks for the tips of the boxplots.
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 25. Read more here about why you should contribute and what is in it for you!
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.