Help using Base SAS procedures

Glimmix - modelling nested random effects

Reply
New Contributor
Posts: 2

Glimmix - modelling nested random effects

I have a basic question regarding modelling random effects in Glimmix.

I have a binary dependent variable.

I have fecal bacterial isolates from 2 cohorts of animals nested within farms, I have multiple samples from animals within the same sampling time, but also over two week intervals.

I have weekly samples from animals. Every time I sampled the animals I have data on 3 isolates per animal and sampling time. I have two cohorts of animals that I followed with approx 6 months apart. I have over 30 farms in my database.

I want to control for the fact that I repeatedly sampled the same animals, but also that I had clustering of animals within a cohort and within a farm.

Since bacterial isolates in these animals are very transitory, it is not really a 'repeated measure' on the animals.

I was thinking something like this below, but am new to glimmix. It seem to have so many random options, I just want to control for the clustering of isolates within animals within cohorts and farms.

Proc glimmix data=;

class animal cohort farm x y:

model y= x/dis=bin link=logit oddsration;

random intercept/subjet=farm;

random intercept/subject=animal(farm) type=un;

run;

Cat.

Respected Advisor
Posts: 2,655

Re: Glimmix - modelling nested random effects

This looks good--some minor typos (oddsration should be oddsratio, subjet should be subject).  I would change the type=un to type=chol, and would add method=quad or method=laplace to the proc statement.  To get:

Proc glimmix method=quad data=

class animal cohort farm x y:

model y= x/dis=bin link=logit oddsratio;

random intercept/subject=farm;

random intercept/subject=animal(farm) type=un;

run;

I hope this helps.

Steve Denham


Ask a Question
Discussion stats
  • 1 reply
  • 170 views
  • 0 likes
  • 2 in conversation