BookmarkSubscribeRSS Feed
Liz_N
Calcite | Level 5

I am trying to work out how to correctly set up the random statement in proc glimmix for my data.

I have an ordinal outcome (grade) that is repeated over time (weeks)

There are two random effects (student, supervisor)

There are a few different fixed effects, some categorical (eg worktype, location) and some are scale (eg: grade-point average)

    

Because the data are multinomial, I can’t model the repeated effects on the R-side and I am wondering how to do it on the G-side correctly. Can this be done?

This is the code I have been working on.

proc glimmix data= mydata method=laplace;

      class student supervisor worktype location week;

      model grade = worktype location week GPA /link=cumlogit dist=multinomial ;

      random intercept week/subject=student;

      random supervisor;

run;

I am wondering how it affects things if I change the random statement to include a type option (for example ARH(1)).

      random intercept week/subject=student type=ARH(1) ;

If I do this will I then be modelling a repeated covariance structure through the type option?

Any ideas appreciated.

4 REPLIES 4
SteveDenham
Jade | Level 19

I love answering questions like this.  You have everything in place for the design you specified.  I would be a little concerned about forcing an autoregressive structure of any sort on multinomial data (oh, not enough to stop me from doing it, just enough to really look at the results).  If you have enough data, I'd go full out unstructured and use type=chol.

Steve Denham

Liz_N
Calcite | Level 5

That’s very reassuring. Thanks so much for taking the time to look at it
for me Steve. I will be sure to try different covariance structures now that I
know the model is set up properly Smiley Happy

Regarding how it affects things to put in a type= option, this is my
current understanding (from a non-statistician perspective) which I hope I have
right!

random intercept week/subject=student ;

or equivalently

random intercept week/subject=student type=VC ;

This models the trend over weeks by student. That is, whether the effect of week
on grade depends on which student we are talking about, or, put another way,
whether there is a different change in grade over the weeks for each different student.
This accounts for the correlation between repeated measurements on a student, but
assumes the correlation is the same no matter how close together or far apart
the weeks are.


random intercept week/subject=student type=ARH(1) ;

This models the trend over weeks by student and allows the correlation between
repeated measurements on a student to decline as weeks get further apart. Exact
pattern of decline depends on which type= we are talking about. ARH(1) for example,
can accommodate  unequal spacing and change over the weeks whereas AR(1) assumes

that all measurements made the same number of weeks apart share the same correlation

as each other. There are other covariance structures with other patterns and rates of change in variance.

SteveDenham
Jade | Level 19

Pretty close, except that heterogeneous autoregressive DOES assume equal spacing in time, the heterogeneity is in the variance component (diagonal) for each time point (see the documentation for TYPE= in the PROC MIXED documentation),  For unequal spacing in time, you should look at spatial power or a spline.

Steve Denham

Liz_N
Calcite | Level 5

Ah now I get it!

I was mixing up what the diagonal and off-diagonals were for.

Thanks for pointing that out for me Steve :smileycool:

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