Dear all,
I had the observation of children's behavior and the physical environment of their place. Each child joint to its location by a unique id, finally for each child, I have a unique ID as "ID_children" include the behavior and the characteristics of its location as independent variables(X)with consider to some dependent variables as Y (Y_VISUAL_B, Y- SPATIAL, Y- TEMP).
All data was coding binary (0,1).
Before I did chi-square and Pearson Spearman in SAS. Nowadays I am doing "mixed logit".
I have four group of independent variable as:
/*****************************************************************************
MODELES MULTINIVEAU LINÉAIRES
*****************************************************************************/
PROC MIXED DATA=work12.T12 Method=ML COVTEST noclprint noitprint;
Title1 "************************************";
Title2 "MODELES MULTINIVEAUX";
Title3 "MODELE 1: Modèle vide";
Title4 "************************************";
CLASS ID_children;/* Variable définissant l'identifiant du niveau 2 */
MODEL Y_VISUAL_A = /SOLUTION;
RANDOM intercept/SUBJECT= ID_children ;
RUN;
/*****************************************************************************
MODELES MULTINIVEAU LINÉAIRES
*****************************************************************************/
PROC MIXED noclprint DATA=Work1.Test1 Method=ML COVTEST;
Title1 "************************************";
Title2 "MODELES MULTINIVEAUX";
Title3 "MODELE 2: Prédicteurs au niveau 1";
Title4 "************************************";
CLASS ID_children /* Variable définissant l'identifiant du niveau 2 */
MODEL Y_VISUAL_A = AGE GENDER / SOLUTION ddfm=bw;
RANDOM intercept/SUBJECT= ID_children;
RUN;
PROC MIXED noclprint DATA=work12.T12 Method=ML COVTEST;
Title1 "************************************";
Title2 "MODELES MULTINIVEAUX";
Title3 "MODELE 3: Predicteurs au niveau 2";
Title4 "************************************";
CLASS ID_children /* Variable définissant l'identifiant du niveau 2 */
MODEL Y_VISUAL_A = ACT_BEF DESTINATION_A D CONTACT_CLOSE_AFT FALSE_START ; / SOLUTION ddfm=bw;
RANDOM intercept / SUBJECT=ID_children;
RUN;
PROC MIXED DATA=work12.T12 Method=ML COVTEST noclprint;
Title1 "************************************";
Title2 "MODELES MULTINIVEAUX";
Title3 "MODELE 4: Predicteurs aux niveau 1 et 2";
Title4 "************************************";
CLASS ID_children; /* Variable définissant l'identifiant du niveau 2 */
MODEL Y_VISUAL_A = /* Niveau 1 */
AGE GENDER
/* Niveau 2 */
ACT_BEF DESTINATION_A D CONTACT_CLOSE_AFT FALSE_START / SOLUTION ddfm=bw;
RANDOM intercept / SUBJECT=ID_children;
RUN;
I decide to use "mixed logit" to examine these independent variables in the separate group for each Y.
I did not have any experience in SAS, but I prefer to do the statical part of my project in the high capacity software like SAS.
This is the first draft of mixed logic that I create in SAS.
Now, I have some question, I appreciate if you guide me.
First, I don't have exactly, which "class" and " subject " is ok for my data.
then is it "Random " or "Repeat"
Third, I have more than 2 level of data ( For level), How can I do them in " mixed logit".
I tried to explain clearly, I am waiting for your kindly guide.
Thanks ,
Moji
If I was right, PROC MIXED is not able to run logistic model, try PROC GLIMMIX .
Hi Moji,
Many people struggle to understand when to use RANDOM or REPEATED. I recommend the paper "Tips and Strategies for Mixed Modeling with SAS/STAT Procedures." which addresses this issue and also gives other suggestions for mixed modeling. I also recommend "Advanced Techniques for Fitting Mixed Models Using SAS/STAT Software" by the same authors.
Hi Rick,
thanks for useful articles, I read them.
As I found I can use the unique Id that I have in the dataset as "Class" and "subject" in 'PROC MIXED". Because just this Column is unique for each child.
Second, my project examined children randomly in street with considering to age (between 4-12 years old), so can I use "RANDOM"? Because, I observed the behavior of children and the characteristics of their location, and I had no repetition.
Third, my database includes the different categories that I can use "children Id " for each group. Could you please guide me, how can I have them in a different category in SAS. As you can see in SAS model that showed previously, I found the formula in 2 level, but I have 4 level of data (individual, behavior, physical environment and crossing situation). I don't know if this possible or not?
I really interested to do this part of my project in SAS, however, i don't have enough information.
I appreciate if you guide me.
Best regards
Moji
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.