BookmarkSubscribeRSS Feed
AJ8
Calcite | Level 5 AJ8
Calcite | Level 5

Hi there!

 

I was trying to run a 2-level model, but the random effects are showing up as zeros. Here are my codes:

 

proc glimmix data = ONE METHOD=RSPL NOCLPRINT;

CLASS Researcher_Identity Researcher_Factor1 Researcher_Factor2 Patient_Factor1 Pateint_Factor2;

MODEL Outcome = Researcher_Factor1 Researcher_Factor2  Patient_Factor1 Pateint_Factor2  / DIST=Binary LINK=logit;

RANDOM Intercept / subject= Researcher_Identity TYPE=VC G;

run;

 

THANK YOU SO MUCH!

7 REPLIES 7
PaigeMiller
Diamond | Level 26

It's not clear to me that you have actually stated a question or stated a problem.

 

Zero is a valid result, depending on your data.

 

Please elaborate. If possible, provide your data.

--
Paige Miller
AJ8
Calcite | Level 5 AJ8
Calcite | Level 5

Hi there!

 

Thank you for your response and sorry for not stating the issue.

 

Basically, I am trying to put people's identity at the second level and see if there is any random effect. I have a bunch of other variables mostly ordinal and dummy at the first level, such as age group, years of experience, gender etc. Data looks something like this:

 

ID   ID's_Gender   ID's_Age_Group   Outcome    Variable1   Variable2

1          F                           1                    Yes            1                3

1          F                           1                     No             2                3

1          F                           1                     No             1                2

2         M                            2                    Yes            2                2

2         M                            2                    Yes            1                3

 

So here are my quetsions:

 

1) My random effects turned out to be all zero. How do I tell if the zero is a valid result?

2) If it is, can I conclude that there is no random effect and change the model to a logistic regression and simply place people's identity as a vairable? If I do this then I am not able to control for any variables related to the ID. 

 

Because the question of interest is really to see how a perosn did comparing to another.

 

THANK YOU SO MUCH!

 

 

PaigeMiller
Diamond | Level 26

I'm still not sure I can help ... your variable names in PROC GLIMMIX don't match the sample data you provided, so I have no idea how they relate to the model statement.

 

Nevertheless, it still is possible for 0 to be the result. This happens either because you have mis-specified the model (something I won't comment on, as I have no idea what the experiment is or what you want to do with this data), or because the variability is truly zero.

 

Again, to answer your questions, we'd need a discussion of the problem, a discussion of the experiment, and why this model fits the experiment, and we probably need the entire data set, which you probably can't provide.

--
Paige Miller
AJ8
Calcite | Level 5 AJ8
Calcite | Level 5

Hi there,

 

using the data I have provided, the code would look something like this:

 

proc glimmix data = ONE METHOD=RSPL NOCLPRINT;

CLASS ID ID's_Gender Variable1 Variable2

MODEL Outcome = ID's_Gender ID's_AgeGroup Variable1 Variable2  / DIST=Binary LINK=logit;

RANDOM Intercept / subject= ID TYPE=VC G;

run;

PaigeMiller
Diamond | Level 26

There's a lot more information I asked for, and it hasn't been provided.

 

In other words, without a description of the experiment, and the full data (which you may not be able to provide), there's no way I can say if the 0 value is correct. You might want to find a statistician where you work/where you go to school and see if that statistician can help.

 

And I am curious to understand how your variable names in SAS can have an apostrophe in the variable name ...

--
Paige Miller
Rick_SAS
SAS Super FREQ

Assuming that you haven't accidentally specified the NOINT option, a possible explanation is that you have a linear dependency (multicollinearity) in your explanatory variables.  Are there any NOTEs in the SAS log about matrices not being positive definite?  Please copy/paste the complete SAS log so we can see the exact messages.

 

 

AJ8
Calcite | Level 5 AJ8
Calcite | Level 5

Hi there!

 

Thank you so much for your response! I realized that I actually included a wrong variable by accident and I am all good now.

 

THANK YOU!

 

 

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
  • 7 replies
  • 1691 views
  • 0 likes
  • 3 in conversation