All the SAS output seems normal, and there is no warning or error in log, the estimate of covariance parameter can be obtained when the type is compound symmetry, but the standard error is not estimable, I want to know why and is it a critical issue?
For some confidential reason, i can't show the data, but i can give a brife introduction to the data:
the data is create for efficacy analyses for 2 drugs (0.01% 0.02%) vs placebo (represented by variable trt01pn), there are several repeated assessments (represented by variable avisitn1) for each subject, and at each assessment time point, 2 results will be obtained from 2 eyes(left or right, represented by variable oelat) respectively, the response result to drug is success or failure(represented by variable response1), other variables used in model are covariates (like randage AMETROPI).
And here is the SAS code i use:
ods output estimates=out_est.;
proc glimmix data=data empirical method=quad;
class subjid trt01pn(ref='3') avisitn1(ref='6') oelat randage AMETROPI;
model response1= trt01pn avisitn1 oelat randage AMETROPI trt01pn*avisitn1 / dist=binary link=logit solution or;
nloptions maxiter=200;
random intercept / subject=subjid type=vc;
random intercept / subject=oelat(subjid) type=cs;
estimate '0.01% vs placebo at M12 ' trt01pn 1 0 -1 trt01pn*avisitn1 1 0 0 0 -1 0/ exp cl;
estimate '0.02% vs placebo at M12' trt01pn 0 1 -1 trt01pn*avisitn1 0 0 1 0 -1 0/ exp cl;
estimate '0.02% vs 0.01% at M12' trt01pn -1 1 0 trt01pn*avisitn1 -1 0 1 0 0 0/ exp cl;
run;
Thank you very much for your help!
If you want to correlate observations from the same subject and from the same eye within a subject, then you need
random int / subject=subjid;
random int / subject=oelat(subjid);
The CS is overfitting this model and is not needed if you want correlation amongst the subjects and eyes within a subject. Note that you will need multiple observations on each eye for this to work. From your description, I think you have that ... but not 100% sure.
Thank you very much for the reply!
yes, I do have 2 assessments for each eye and subject (assessments at month 6 and month 12). so, usually, there are 4 records for each subject. but I don't understand why compound symmetry is over fitting for this data? can you explain more? thank you very much in advance!
This statement --
random intercept / subject=oelat(subjid) type=cs;
models a random intercept. So for each subject, there is only one random effect -- intercept. TYPE=CS is too much. Use TYPE=VC for the random intercept.
Hope this helps,
Jill
thank you very much for the reply!
but i still don't understand why the non-diagonal parameters are not needed? can you explain more? Thank you very much!
When you fit random effects on the G side (which you are doing with your RANDOM statement in GLIMMIX) then specifying something like
random intercept / subject=id;
will fit a common covariance to all the observations with with same id value. This fits a block-diagonal structure through Z'GZ. You do not need a covariance structure on the RANDOM statement to achieve this.
When you fit random effects on the R side (using the RESIDUAL keyword on the RANDOM STATEMENT in GLIMMIX or the REPEATED statement in MIXED) then you need TYPE=CS to get this block diagonal structure. V=Z'GZ + R, so you need to specify the covariance structure for the R part here.
You can confirm this behavior through the V option on the RANDOM statement. V shows blocks of the V matrix when GLIMMIX (or MIXED) can partition V into blocks (it needs the same subject or nested subjects on multiple RANDOM statements to do this). Use V=2 to see the block for the 2nd subject.
Thank you very much for the reply! i'm not sure if i fully understand what you mean because the knowledge about R/G side was learnt months ago... anyway, i will learn them again and come back.
Could you have a look on the below picture? it explained why CS was choosen as the covariance structure for eyes, it was reasonable for me when i first see it, so i followed the slids and choosed CS as the covariance structure, but then...... do you think the clarification on the slids is correct?
With TYPE=CS on the 2nd RANDOM statement, you are likely getting a message in the log that says either the G matrix is non-positive definite or the Hessian is non-positive definite. You are also likely to see that the CS parameter in the GLIMMIX output is 0, or that if you remove TYPE=CS then you will see that two of the parameters in the model with TYPE=CS sum to one of the parameters in the model without TYPE=CS.
In the slide you reference, the second RANDOM statement with SUBJECT=PTID correlates all of the observations from the same patient. The first RANDOM statement, with SUBJECT=EYE(PTID) and leaving off TYPE=CS, correlates the observations from the same eye within a subject. If you use the V option as I suggested earlier, you will see a block diagonal covariance structure that shows this correlation pattern. Here is an example:
This is the result of the V option for 2 subjects. The first 3 rows and columns are for 3 observations on eye 1 for subject 1. Rows and columns 4-6 are for 3 observations on eye 2 for subject 1. This structure was obtained without using TYPE=CS on the RANDOM statement for SUBJECT=EYE(PTID). You get a correlation within the eyes and within all observations on the same subject.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.