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?
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
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
Than you Steve! Also for the other suggestion.
Very much appreciated.
Ema
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.