BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
emaneman
Pyrite | Level 9

Dear all,

 

I need to use PROC MDC to assess the effects of two continuous predictors on a dichotomous variable.

 

The two continuous predictors are  "Email_Tot" and "Texting_Tot". Each participant has one value for each predictor.

The DV is called "Eyes" and comprises of 36 items for which there is a wrong (0) and correct (1) answer.  Thus, each participant has 36 lines in the dataset. This is a sample of observations to give you an idea of the dataset:

 

URN Item Eyes Email_Tot Texting_Tot

1 Q1 0 8.25 6.666666667

1 Q2 1 8.25 6.666666667

1 Q3 0 8.25 6.666666667

...

1 Q36 1 8.25 6.666666667

2 Q1 1 5.25 5.333333333

2 Q2 0 5.25 5.333333333

2 Q3 1 5.25 5.333333333

...

2 Q36 1 5.25 5.333333333

 

I had tested the model using PROC LOGISTIC, but I am now asked to test it using a mixed logit model, with a crossed random effects structure comprising random intercepts for participants ("URN") and "Item" -- with the suggestion that I use Laplace approximation  to estimate the fixed effects parameters for the outcome variable ("Eyes").

 

I am somewhat familiar with PROC MIXED, so I tested the following :

 

proc mixed ;
class urn item;
model eyes = Email_Tot Texting_Tot  /solution cl;
random urn item;

 

Can you help me do the conceptual equivalent to this model using PROC MDC?

 

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

Whoever requested you to test "using a mixed logit model, with a crossed random effects structure comprising random intercepts for participants ("URN") and "Item" -- with the suggestion that I use Laplace approximation  to estimate the fixed effects parameters for the outcome variable" most likely did not have something like PROC MDC in mind. That wording almost explicitly calls for PROC GLIMMIX (at least in SAS). You can change your PROC MIXED code to something like this:

 

proc glimmix data=have mathod=laplace ;
class urn item;
nloptions maxiter=1000 tech=nrridg;
model eyes = Email_Tot Texting_Tot  /dist= binary link=logit solution cl;
random intercept/subject=urn*item;
run;

If email_tot and texting_tot are identical for all items within an urn, and you are not interested in specific item means averaged over urns, then you could make this a bit easier as far as memory and runtime go. Define 'events' as the sum of Eyes for Q1 through Q36 for each urn. Define 'trials' as the number of nonmissing values for Eyes in Q1 through Q36. Use a data step to get to the following for each line (call this data set have2 for this example):

URN events trials Email_Tot Texting_Tot

Code for analyzing this approach would look like:

 

proc glimmix data=have2 mathod=laplace ;
class urn;
nloptions maxiter=1000 tech=nrridg;
model events/trials = Email_Tot Texting_Tot  /dist= binomial link=logit solution cl;
random intercept/subject=urn;
run;

By summarizing within each urn, you are assuming that the Q's are independent of each other. That may be unrealistic, and why you were asked to do the crossed random effects approach.

 

SteveDenham

 

 

View solution in original post

2 REPLIES 2
SteveDenham
Jade | Level 19

Whoever requested you to test "using a mixed logit model, with a crossed random effects structure comprising random intercepts for participants ("URN") and "Item" -- with the suggestion that I use Laplace approximation  to estimate the fixed effects parameters for the outcome variable" most likely did not have something like PROC MDC in mind. That wording almost explicitly calls for PROC GLIMMIX (at least in SAS). You can change your PROC MIXED code to something like this:

 

proc glimmix data=have mathod=laplace ;
class urn item;
nloptions maxiter=1000 tech=nrridg;
model eyes = Email_Tot Texting_Tot  /dist= binary link=logit solution cl;
random intercept/subject=urn*item;
run;

If email_tot and texting_tot are identical for all items within an urn, and you are not interested in specific item means averaged over urns, then you could make this a bit easier as far as memory and runtime go. Define 'events' as the sum of Eyes for Q1 through Q36 for each urn. Define 'trials' as the number of nonmissing values for Eyes in Q1 through Q36. Use a data step to get to the following for each line (call this data set have2 for this example):

URN events trials Email_Tot Texting_Tot

Code for analyzing this approach would look like:

 

proc glimmix data=have2 mathod=laplace ;
class urn;
nloptions maxiter=1000 tech=nrridg;
model events/trials = Email_Tot Texting_Tot  /dist= binomial link=logit solution cl;
random intercept/subject=urn;
run;

By summarizing within each urn, you are assuming that the Q's are independent of each other. That may be unrealistic, and why you were asked to do the crossed random effects approach.

 

SteveDenham

 

 

emaneman
Pyrite | Level 9

Than you Steve! Also for the other suggestion. 

Very much appreciated.

Ema

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
  • 2 replies
  • 707 views
  • 2 likes
  • 2 in conversation