BookmarkSubscribeRSS Feed
AnnaB
Calcite | Level 5

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.

1 REPLY 1
SteveDenham
Jade | Level 19

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


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 Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 3104 views
  • 0 likes
  • 2 in conversation