BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kai_cody
Fluorite | Level 6

Hi all,

 

I am using PROC GLIMMIX perform a longitudinal binary mixed effects model on complex survey data. I am unsure what I need to do with the RANDOM statements to account for everything. Completely new to mixed effects models, sorry!

 

First, I have cluster (PSU - 2 levels), strata (99 levels), and final weights for each ID for each of four timepoints (Wave 1, 2, 3, 4 -- "repeated measures"). Here is an example of my dataset structure for the first two ID participants:

 

ID        WAVE      PSU       STRATA     WEIGHT          STROKE 

1           1              2             94              34724.3           No

1           2              2             94              48284.2           No

1           3              2             94              52843.3           No

1           4              2             94              48848.4           Yes

2           1              1             55              553.6               No

2           2              1             55              364.1               No

2           3              1             55              152.4               No

2           4              1             55              868.0               No

 

How should my PROC GLIMMIX code look? Here is what I have below, but does this account correctly for everything? Should I account for weighting in a separate WEIGHT statement?

 

proc glimmix data=DATASET method=quad;
class ID WAVE PSU STRATA V1 V2;
model STROKE = V1 V2  WAVE / dist=bin link=logit solution;
random PSU(STRATA) / subject=ID weight=WEIGHT;
random WAVE / subject=ID weight=WEIGHT;
run;

 

Thank you very much!

1 ACCEPTED SOLUTION

Accepted Solutions
kai_cody
Fluorite | Level 6

This is what I ended up with. I think it is correct, but now SAS is saying there is insufficient memory to run this, even after I adjusted MEMSIZE. But anyways, maybe this is helpful:

 

proc sort data=PATH_DATA;
by ID WAVE; run;


proc glimmix data=PATH_DATA;
class GENDER2 RACE2 HISPANIC2 AGE2 ALCOHOL CIG DIABETE EDUC1 EMPLOY1 DUAL VARPSU VARSTRAT INCOME MARITAL1 BMI INSURANCE1 REGION1;
model STROKE = GENDER2 RACE2 HISPANIC2 WAVE AGE2 ALCOHOL CIG DIABETE EDUC1 EMPLOY1 DUAL INCOME MARITAL1 BMI INSURANCE1 REGION1/ link=logit solution oddsratio;
random WAVE intercept / subject=ID;
random VARPSU(VARSTRAT);
weight WEIGHT;
run;

View solution in original post

2 REPLIES 2
kai_cody
Fluorite | Level 6

This is what I ended up with. I think it is correct, but now SAS is saying there is insufficient memory to run this, even after I adjusted MEMSIZE. But anyways, maybe this is helpful:

 

proc sort data=PATH_DATA;
by ID WAVE; run;


proc glimmix data=PATH_DATA;
class GENDER2 RACE2 HISPANIC2 AGE2 ALCOHOL CIG DIABETE EDUC1 EMPLOY1 DUAL VARPSU VARSTRAT INCOME MARITAL1 BMI INSURANCE1 REGION1;
model STROKE = GENDER2 RACE2 HISPANIC2 WAVE AGE2 ALCOHOL CIG DIABETE EDUC1 EMPLOY1 DUAL INCOME MARITAL1 BMI INSURANCE1 REGION1/ link=logit solution oddsratio;
random WAVE intercept / subject=ID;
random VARPSU(VARSTRAT);
weight WEIGHT;
run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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