BookmarkSubscribeRSS Feed
Melk
Lapis Lazuli | Level 10

I am running a proc mixed with 1 fixed treatment effect and a random nested effect of eye within ID.

 

proc mixed data = dat;
    class id tx eye;
    model y= tx/solution;
    random time/ subject=eye(id);
    lsmeans tx / pdiff adjust=tukey;
run;

 

My random statement kind of confuses me - I have a random effect of eye within id, over continuous time. How does this affect my interpretation of my tx effect?

 

5 REPLIES 5
StatsMan
SAS Super FREQ

The RANDOM statement is fitting a random slope for time, separately for each eye within id.  

 

Most models like this have TIME also as a fixed effect on the MODEL statement.  That way, you are fitting a random adjustment for each eye within id to an overall slope.  The overall slope comes from TIME on the MODEL statement and the random adjustment comes from the RANDOM statement.

 

This model would assume that the line you are fitting for each EYE(ID) has the same intercept, and intercept obtained through the MODEL statement.  Changing the RANDOM statement to 

 

   random int time / subject=eye(id);

 

would give you a random adjustment to the overall intercept AND a random adjustment to the overall slope on time for each EYE(ID).  You could also add TYPE=UN if you wish to correlate those random intercept and slope adjustments.  

 

Bottom line is the RANDOM statement you have would be unusual to see in practice.  Changing to the one above would be more typical.  However, there could be overriding reasons for you to use the one you have.  

Melk
Lapis Lazuli | Level 10

I only have 10 subjects in each of my group so about 20 eyes per group, this is the only model I got which did not give me a G matrix error. Not sure if there are any other tips for small samples sizes of this design.

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

IF your model is correctly specified, then there is nothing inherently wrong with "NOTE: Estimated G matrix is not positive definite." See page 9 in this paper for more detail about why the note occurs and what, if anything, you should do about it:

 

http://support.sas.com/resources/papers/proceedings12/332-2012.pdf

 

I'm going to refer you to your other thread that appears to deal with the same analysis:

 

https://communities.sas.com/t5/SAS-Statistical-Procedures/modeling-right-and-left-eye-in-a-mixed-mod...

 

In my response there, I make the same point that @StatsMan makes: that TIME probably should be included in the MODEL statement. Based on the information you provided in your other thread, I do not think the model specification in this current thread is correct.

 

.

Melk
Lapis Lazuli | Level 10

I looked at the group by time interaction in the model and because it was NS and because it was not part of the research question, I removed it to not overparameterize the small sample size. Hmm

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

If you plot response versus time for each subject in each group, do you see any evidence that the response changes over time?

 

You may decide to omit tx*time from the MODEL statement, but you'll want to keep in mind that failure to detect a significant interaction does not mean that the interaction does not exist; this is a particular concern with small sample sizes where you may have low power to detect the interaction.

 

Even if you omit tx*time, you could still include the main effect of time.

 

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
  • 5 replies
  • 3106 views
  • 2 likes
  • 3 in conversation