I am building a generalized linear mixed model in SAS. Unfortunately, this is the first time I’m working with GLMMs and I am not very familiar with SAS. I have been using proc GLIMMIX. I have data from 4 sites, each specified with a 4 letter code in the variable site. Each site was sampled 11 times. A crossover design was used for treatment, so 2 sites were treated for the first 5 weeks of the study, and the other 2 sites were treated for the last 6 weeks of the study. I’ve incorporated this into the model with a variable called order with a value 1 for treatment 1st and 2 for treatment 2nd, and a variable called treatment that reads yes when treatment was present and no when treatment was absent. My response variable should be normally distributed. My current code is:

proc glimmix data=data;

class Treatment Site Order;

model Response = Treatment Order Site;

random Site;

random Order;


Is this too simplistic? My goal is to figure out what effect treatment, order, and site had on the response variable and to determine which variables are necessary in the model. I know I will have to run the model multiple times with different combinations of variables and compare AIC values to determine which variables are necessary (unless there is a way to do this in SAS?). Do I need to change any of the other default parameters? Do I need to make Site and/or Order a random_residual variable instead? Thank you! Any advice is appreciated.


if the response is normal maybe you don´t need a GLM. What is "Response" this is basic questions that need to be answered before going into generalized (non-normal-response) models. Since you have samples over time probably is a good idea to consider also a mixed model approach in order to count for correlation among measurements within an experimental unit. Loos at PROC Mixed and NLMIXED


H. Gilabert PUC de Chile, Dept. of Ecosystems & Environment


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.