turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Repeated measure ANOVA

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-17-2008 10:14 PM

My dataset has 16 subjects, each subject was exposed to 3 treatments, each treatment was repeated 4 times. So there is a correlation b/w the 4 times within a treatment, and another correlation factor b/w the 3 treatments within a subjects. The data looks like

ID Treatment Time

1 1 1

1 1 2

... ... ...

1 1 4

1 2 1

... ... ...

1 2 4

... ... ...

1 3 4

So the correlation matrix for subject 1 should be a 12*12 matrix, formed by 3*3=9 block matrices, and each matrix is a 4*4. The 3 diagonal 4*4 matrices should be the same. The off-diagonal 4*4 matrices don't need to be the same.

There are 2 difference correlation factors within a subject. My question is how to specify such a correlation matrix. Hopefully the correlation matrix should look like something like this

1 .5 .5 .5 .3 .3 .3 .3 .1 .1 .1 .1

.5 1 .5 .5 .3 .3 .3 .3 .1 .1 .1 .1

.5 .5 1 .5 .3 .3 .3 .3 .1 .1 .1 .1

.5 .5 .5 1 .3 .3 .3 .3 .1 .1 .1 .1

.3 .3 .3 .3 1 .5 .5 .5 .2 .2 .2 .2

.3 .3 .3 .3 .5 1 .5 .5 .2 .2 .2 .2

.3 .3 .3 .3 .5 .5 1 .5 .2 .2 .2 .2

.3 .3 .3 .3 .5 .5 .5 1 .2 .2 .2 .2

.1 .1 .1 .1 .2 .2 .2 .2 1 .5 .5 .5

.1 .1 .1 .1 .2 .2 .2 .2 .5 1 .5 .5

.1 .1 .1 .1 .2 .2 .2 .2 .5 .5 1 .5

.1 .1 .1 .1 .2 .2 .2 .2 .5 .5 .5 1

I used PROC MIXED

If I specify RANDOM INT/ subject=ID, then all the off-diagonal will be the same. If I specify RANDOM INT/ subject=ID*TREATMENT, then I can only get a 4*4 correlation matrix, with no off-diagonal blocks.

ID Treatment Time

1 1 1

1 1 2

... ... ...

1 1 4

1 2 1

... ... ...

1 2 4

... ... ...

1 3 4

So the correlation matrix for subject 1 should be a 12*12 matrix, formed by 3*3=9 block matrices, and each matrix is a 4*4. The 3 diagonal 4*4 matrices should be the same. The off-diagonal 4*4 matrices don't need to be the same.

There are 2 difference correlation factors within a subject. My question is how to specify such a correlation matrix. Hopefully the correlation matrix should look like something like this

1 .5 .5 .5 .3 .3 .3 .3 .1 .1 .1 .1

.5 1 .5 .5 .3 .3 .3 .3 .1 .1 .1 .1

.5 .5 1 .5 .3 .3 .3 .3 .1 .1 .1 .1

.5 .5 .5 1 .3 .3 .3 .3 .1 .1 .1 .1

.3 .3 .3 .3 1 .5 .5 .5 .2 .2 .2 .2

.3 .3 .3 .3 .5 1 .5 .5 .2 .2 .2 .2

.3 .3 .3 .3 .5 .5 1 .5 .2 .2 .2 .2

.3 .3 .3 .3 .5 .5 .5 1 .2 .2 .2 .2

.1 .1 .1 .1 .2 .2 .2 .2 1 .5 .5 .5

.1 .1 .1 .1 .2 .2 .2 .2 .5 1 .5 .5

.1 .1 .1 .1 .2 .2 .2 .2 .5 .5 1 .5

.1 .1 .1 .1 .2 .2 .2 .2 .5 .5 .5 1

I used PROC MIXED

If I specify RANDOM INT/ subject=ID, then all the off-diagonal will be the same. If I specify RANDOM INT/ subject=ID*TREATMENT, then I can only get a 4*4 correlation matrix, with no off-diagonal blocks.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-19-2008 10:28 AM

This post is kind of sinking, but I really need some hints there.

Anyone please, if you feel you can help but I didn't state my question clearly, let me know.

Thanks.

Anyone please, if you feel you can help but I didn't state my question clearly, let me know.

Thanks.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-26-2008 10:44 AM

If you want the off-diagonals, look at the TYPE= option. TYPE=UN should certainly give what you need. The problem here is that you have 66 cov parms to estimate, with only 192 obs. Things may not converge real well. DO NOT specify a GROUP=treatment option to model different covariances within treatment. That leads to 192 cov parms.

Good luck.

Good luck.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-01-2008 12:28 AM

Thank you for your reply.

I know I can try type=un, but that's not what I really want. As you can see from my example, I'd like something with kind of compond symmetry with elements as blocks. So there are much less parameters needed for estimation. In my example, for that 12*12 correlation matrix, only 4 parameters will be enough to describe the relationship.

I know I can try type=un, but that's not what I really want. As you can see from my example, I'd like something with kind of compond symmetry with elements as blocks. So there are much less parameters needed for estimation. In my example, for that 12*12 correlation matrix, only 4 parameters will be enough to describe the relationship.