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

I'm working on a longitudinal model with subjects nested in different treatment methods looking at a binary endpoint for completion.  I'd like to adjust them for some baseline factors (age, gender) but then I'd like to get an overall completion probability for each treatment alone and each treatment at each time point because there is an interaction.  Because of the nesting I've modeled the adjusted predictive probabilities in proc mixed using the same random effects for the overall by treatment and added the time to the model outputting the LS means for each time point.  I've seen this done when there are no random effects with proc logistic and then modeling the predictive values in proc means, but are there any assumptions I'm violating by using this process with Glimmix and Mixed?  I haven't been able to find anything in the literature to outline this process.  Thanks in advance for your help.

 

Example data

Fullid      method    age_cat    sex  time   value_miss

88        Electronic    35-44        M    1        1

88        Electronic    35-44        M    2        0

88        Electronic    35-44        M    3        1

77        Paper          25-34        F     1        1

77        Paper          25-34        F     2        1

77        Paper          25-34        F     3        0

 

 

proc glimmix data=full;

where method in ("Electronic", "Paper");

format age_cat age_cat.;

class age_cat(ref="35-44") sex time value_miss method full_id;

model value_miss= age_cat sex time method method*time/cl oddsratio dist=binary s;

random intercept /subject= full_id(method) ;

output out=pred_elec_full pred(blup ilink)=pred_val;

lsmeans method/ cl or diff;

lsmeans method*time /cl or diff;

run;

 

/*to get the overall predictive probability by method*/

proc sort data=pred_elec_full; by method;

ods table solutionf=e_pred_full4;

proc mixed data=pred_elec_full;

by method;

class full_id method;

model pred_val=/s cl;

random intercept /subject= full_id(method) ;

run;

 

/*to get the predictive probability by method for each time point*/

ods table lsmeans=e_pred_fullbytime;

proc mixed data=pred_elec_full;

by method ;

class full_id method time;

model pred_val=time/s cl;

random intercept /subject= full_id(method) ;

lsmeans time/ cl;

run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

Your stated goal of estimating "overall" probabilities for the treatments suggests that a population-averaged model, such as a GEE model, might be more suitable than the subject-specific random effects model you have used. If you take that approach, you could fit the model in PROC GENMOD or PROC GEE with a REPEATED statement and then use either the Margins macro (if you want predictive margins to allow some predictors to not be fixed) or the NLMeans macro (if all predictors are fixed as with LS-means). Either will provide estimates of population means (probabilities in this case) and can compare them. You can see both in the example in this note. More examples of using these macros are in their documentation using the links above.

View solution in original post

2 REPLIES 2
SteveDenham
Jade | Level 19

This looks to me to be a lot like what the %NLmeans macro is meant for.  Calling @StatDave  as he seems to be the guru in this area.

 

SteveDenham

StatDave
SAS Super FREQ

Your stated goal of estimating "overall" probabilities for the treatments suggests that a population-averaged model, such as a GEE model, might be more suitable than the subject-specific random effects model you have used. If you take that approach, you could fit the model in PROC GENMOD or PROC GEE with a REPEATED statement and then use either the Margins macro (if you want predictive margins to allow some predictors to not be fixed) or the NLMeans macro (if all predictors are fixed as with LS-means). Either will provide estimates of population means (probabilities in this case) and can compare them. You can see both in the example in this note. More examples of using these macros are in their documentation using the links above.

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
  • 486 views
  • 4 likes
  • 3 in conversation