Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Two repeated measures in GLIMMIX

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 05-01-2018 08:03 PM
(1715 views)

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;

7 REPLIES 7

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Moved to "SAS procedures" forum.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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 😎

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Ok! Thank you much in advance!!!

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

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.