Programming the statistical procedures from SAS

Two repeated measures in GLIMMIX

Reply
Contributor
Posts: 22

Two repeated measures in GLIMMIX

HI Everyone!

I was trying on GLIMMIX SAS procedure. I have five independent variables in my data,i.e source, cpg, ICC, BMI and IDD. 

Among those variable source and cpq are repeated measured variables in which variable source have two categories(source1 and

source2). Each level of source contains three categories of cpq(cpq1,cpq2 and cpq3). This means cpq variable is nested into source and source nested to each individuals. My response variable is binary(Resp). How can i account correlation for the two variable source and cpq. Here note that: these two repeated variables are also my interest that i need to see their effect on the response variable.

 

I tried the sas code below. Could you comment by correcting it so that the model can account the correlation and correctly 

estimate effects of variable on the response.

proc glimmix data=Thesis.data;
class source cpg IDD  ;
model Resp=  source cpg ICC BMI IDD / dist=bin solution;
random intercept /subject=source type=cs;
random intercept /subject=cpg type=cs;
run;

 

PROC Star
Posts: 2,370

Re: Two repeated measures in GLIMMIX

Moved to "SAS procedures" forum.

PROC Star
PROC Star
Posts: 404

Re: Two repeated measures in GLIMMIX

When you are working with mixed models, it is important to clearly distinguish between experimental treatments (fixed effects factors) and experimental units (random effects factors).

 

In GLIMMIX, factors in the MODEL statement are fixed effects factors: they determine the mean of the response. Subjects in the RANDOM statements identify random effects factors that determine the variance of the response; we may use fixed effects factor names to identify levels of a random effects, which will be confusing until you fully understand how the GLIMMIX syntax works.

 

In your code, you are using SOURCE and CPG as both fixed and random effects factors, which is incorrect and suggests that your understanding of how to implement a mixed model is GLIMMIX is not yet sufficient. You'll find these references useful to study:

 

SAS® for Mixed Models, Second Edition

 

Generalized Linear Mixed Models: Modern Concepts, Methods and Applications (especially Ch 2, 7, and 8)

 

 

 

 

Contributor
Posts: 22

Re: Two repeated measures in GLIMMIX

Dear Sld:
Thank you for your nice advice. But still i am confusing that how can i account the correlation of subjects due to those two variables in one model.
PROC Star
PROC Star
Posts: 404

Re: Two repeated measures in GLIMMIX

I am not yet able to provide any advice about your model specification because your description does not clearly identify your experimental design. The resources that I suggested in my previous message will help you determine (1) your fixed effects factors, (2) your random effects factors, and (3) how levels of your fixed effects factors are (ideally) randomly assigned to levels of the appropriate random effects factors. Once these design elements are clear, we may be able to suggest appropriate model specifications.

Contributor
Posts: 22

Re: Two repeated measures in GLIMMIX

Ok!
1) all variables source, cpg, ICC, BMI and IDD are my fixed effects, i.e i want to see their effect on the response variable(Resp). But here cpg is nested to source and source nested to subject ID(i.e from one subject both source 1 and source 2 were measured ). Now the point is that since the two levels of source and three levels of cpg that nested into source is measured from the same subject there will be correlation. How can i account this correlation?
2)Subject ID is my random effect.

PROC Star
PROC Star
Posts: 404

Re: Two repeated measures in GLIMMIX

Given that your dataset name is "Thesis.data", you will have written, or soon will be writing, a Methods section that describes your experiment. If you are willing to share, that would be useful and would contain the information we need.

 

This is what I am guessing about your experimental design:

 

Apparently you have subjects. Subjects is a random effects factor. Each subject has a single value of ICC, BMI, and IDD, which are fixed effects factors.

 

Each subject is "subdivided" into two sub-units; sub-units are nested within subject. Sub-units is a random effects factor. One sub-unit is assigned to one level of SOURCE. SOURCE is a fixed effects factor.

 

Each sub-unit is "subdivided" into three sub-sub-units; sub-sub-units are nested with sub-unit. Sub-sub-units is a random effects factor. One sub-sub-unit is assigned to one level of CPG. CPG is a fixed effects factor.

 

CPG is nested within SOURCE only if the three levels of CPG for SOURCE=1 are different than the three levels of CPG for SOURCE=2. If you have only 3 levels of CPG and these 3 levels are used with both SOURCE =1 and =2, then CPG is crossed with SOURCE. If these concepts of "nested" and "crossed" are unfamiliar to you, then you need to study the resources I suggested. Another good resource is Analysis of Messy Data Volume 1: Designed Experiments, Second Edition. Once you've done that, feel free to post code if you would still like feedback.

 

 

Contributor
Posts: 22

Re: Two repeated measures in GLIMMIX

Ok! Thank you much in advance!!!
Ask a Question
Discussion stats
  • 7 replies
  • 223 views
  • 0 likes
  • 3 in conversation