BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
1 REPLY 1
1162
Calcite | Level 5
In the REPEATED statement, there is an option called TYPE= that allows you to specify the covariance matrix. Try compound symmetry (CS) or autoregressive 1 (AR(1)). Autoregressive may suit you better since the correlation between two timepoints could be considered higher if the timepoints are closer together.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 1 reply
  • 1358 views
  • 0 likes
  • 2 in conversation