BookmarkSubscribeRSS Feed
BayzidurRahman
Obsidian | Level 7

Hi,
I have data from Stepped wedge cluster RCT with 2 level clustering. The outcome is error rate per patients (number of error/total number of orders). Patients are clustered withing wards and measurements are clustered within patients. one patient can readmit into different wards during the study period which makes the patient level random effects cross-classified. With the following variables, can anyone suggest me the correct model specification with cross-random effects?

ward: unique ward id (level 3)
mrn: unique patient id (levl 2)
error: total number of error (level 1)
totalorder: total number of orders (the offset)
int: intervention (binary variable)

5 REPLIES 5
jiltao
SAS Super FREQ

crossed random effects are specified like something like the following--

random int / subject=ward;
random int / subject=mrn;

(if data allows, sometimes you might also add random int / subject=ward*mrn; but my experience indicates that this random effect is often not supported adequately by data).

Hope this helps,

Jill

BayzidurRahman
Obsidian | Level 7

Thanks Jil. The model runs for ever and not converge.

jiltao
SAS Super FREQ

Crossed random effects models are known to be resource intensive. I am not surprised that it took a very long time.

Can you send in your program? Also how many levels in Ward and how many levels in MRN?

Thanks,

Jill

BayzidurRahman
Obsidian | Level 7
proc glimmix data=tre;
class l2 id period;
model count=period knt1-knt3 / dist=poisson link=log offset=offset;
random intercept / subject=l2;
random intercept / subject=id;
run; 

I have also attached a sample of my dataset.

jiltao
SAS Super FREQ

For the long run time issue, you might try the following approach to see if it helps:

proc sort data=tre;
by id;
run;
proc glimmix data=tre; class l2 period; model count=period knt1-knt3 / dist=poisson link=log offset=offset; random intercept / subject=l2; random intercept / subject=id; run;

For the convergence issue, you might want to double check your offset variable -- it should be the log of the measure of exposure. 

Jill

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1354 views
  • 1 like
  • 2 in conversation