04-26-2012 11:43 AM
Hello all!! sorry for the duplicated but I am not sure if i posted it write before :s_e
I am performing a glimm on multinomial nominal response variable, (as seen below), and I have several random effects that i need to include.
First I have several "responses" on the same individual and then I included line 4.
But I also would like to include 1 or 2 more random variables: A) would be a variable grouping individuals, we will call it, FAMILY and B) would be a temporally grouping variable , such as YEAR.
This type of model forces me to include the statement "GROUP" in the random so....How could I include them in the script below?
1)proc glimmix data=data;
2)class response individual year;
3)model response = landscapevariable1 landscapevariable2 / dist=mult link=glogit;
4)random intercept / sub= individual group=response;
My guess would be:
random intercept family year / sub= individual(family) group=response; ????
Thank you so much in advance
04-27-2012 07:50 AM
Not sure if I have the design correct, but:
The two variables (landscapevariable1 and 2) are continuous measures that you use to predict response. That strikes me as very unusual for a multinomial--you have no classes here, so GLIMMIX will fit these as continuous covariates. More information on these would be extremely useful.
YEAR stands alone as a random effect. I assume that the families and individuals observed in any one YEAR are different from those in all other YEARs. If not, then you may have a repeated effect, and I don't want to go there just yet.
INDIVIDUAL is always nested within FAMILY.
RESPONSE is a dependent variable. It should probably not be included in the CLASS statement.
So, what about two random statements:
proc glimmix data=data;
class individual family year;
model response = landscapevariable1 landscapevariable2 / dist=mult link=glogit;
random intercept family/subject=individual;
Now, about the GROUP= option in the random statements. This may be an opportunity for me to learn something. I have never seen grouping by the dependent variable, so I excluded it in my code. It looks like you want to accommodate heterogeneity of variance for the dependent outcomes.
The more I consider this, the more likely I think it is that I have misinterpreted the design.
Is it possible that the landscapevariables are the actual dependent variables?
Waiting for more info.
04-27-2012 09:29 AM
First of all thank you so much for your answer and second of all, sorry for my lousy explanation of the design, i will try to clarify it better now
My design consist on the causes of death of some animals, i have several data for each animal and the options ((response variable)are alive, dead by predator 1 and dead by predator 2. And in those locations where they are alive or predated they are in certain landscape environments. the idea is to understand if the odds of dying by one cause or other increase in certain environments. At the same time data were taken 2 different years and the animals are grouped by family groups. i hope i was more clear now
1) YES, landscapevariable1 and 2 are CERTAINLY continuous measures AND INDEPENDENT VARIABLES.
2)YES, the families and individuals observed in any one YEAR are AS YOU ASSUME different from one year to the other.
3) I think the response variable HAS TO BE Classified as Class according to the mannual in the cases of multinomial NOMINAL regressions.
see for example this case found in the manual
model preference(ref=first) = feature price /
random intercept / subject=store group=preference;
4) Thank you for the suggestion of the random effects, it makes sense and i am totally going to try that , thanks a lot.
5) the only problem is that glimmix multinomial link=glogit they ask me to introduce the GROUP= option into ALL random statements if not it gives the error
"Nominal models require that the response variable is a group effect on RANDOM statements. You need to add 'GROUP=response" so your random would end up being:
random intercept family/subject=individual group=response;
random year/subject=individual(family) group=response;
i hope i was more clear now , thanks a lot anyway
04-27-2012 10:27 AM
See. I knew I would learn something new on this. So, those look like reasonable random statements at this point.
Everything looks in order. Since everything is G-side, I would select METHOD=QUAD in the PROC statement, but that is a matter of preference, and like a lot of things in GLIMMIX, may not be available for a nominal multinomial.
Do you plan on calculating specific odds ratios? I only ask because the default would be calculated at the mean of landscape1 and the mean of landscape2, and it sounds to me like you may want to investigate the odds ratios at different values of these endpoints. I think that is a subject for a different day and the ESTIMATE statement.
05-02-2012 04:03 AM
Thank you so much again for your answer and yes I plan to investigate specific odds ratios by varying the odds ratio statement (adding (at x=value wanted))
thanks a lot