Calcite | Level 5

## Degrees of freedom in proc mixed

I'm a relatively new user to proc mixed and am running a model for a repeated measures mixed model comparing 2 methods of measurement (A and B). AR(1) is the assumed covariance structure for time and subjects have a pair of evaluations (A and B) at 3 time points. My interested is in comparing:

(a) the between-subject variability of each METHOD (obtained from the G matrix),

(b) the within-subject variability of each METHOD (obtained from the R matrix), and

(c) the overall variability of each METHOD (obtained from the V matrix of PTID=1; can also be obtained from a+b)

Can someone tell me how to get the degrees of freedom for these so that I can perform an F-test and make confidence intervals? Any help would be so appreciated. My code follows:

/* N=85 subjects (PTID).  METHOD=A, B.  TIME = 1, 2, 3 (some PTIDs have missing TIME at 2 or 3 ) */

proc mixed method=ml;

class PTID METHOD TIME;

model Y=METHOD / s ddfm=kr;

random METHOD / type=un subj=PTID v g;

repeated METHOD / type=un@ar(1) subj=TIME(PTID) r;

lsmeans METHOD / diff;

run;

4 REPLIES 4
Rhodochrosite | Level 12

## Re: Degrees of freedom in proc mixed

Have you looked at the COVTEST option on the PROC MIXED statement?

The example in Analyzing Multivariate Longitudinal Data Using SAS® appears to be similar to your study.

I hope this helps.

Calcite | Level 5

## Re: Degrees of freedom in proc mixed

Thank you for the suggestion but I want to compare the variability of the two methods: Var(Method a)=Var(Method b). The COVTEST option will test that each of the variances=0 so it doesn't quite get me to where I want to go. e.g.
Rhodochrosite | Level 12

## Re: Degrees of freedom in proc mixed

I think you will have more flexibility with the GLIMMIX procedure with a judicious use of likelihood ratio tests of nested models, some of which can be implemented with the COVTEST statement and others which you'll have to do yourself. For example, you could fit one model with a common variance for methods and compare to a second model with separate variances for methods to test equality of variances. (You could take this approach with MIXED as well.)

GLIMMIX does not allow use of Kronecker products, but I don't see that as much of a problem because there are other modeling options. Advanced Techniques for Fitting Mixed Models Using SAS/STAT® Software (examples on page 5) may be illustrative. The GROUP option on the RANDOM statement might be useful.

I don't know of a way to get an F-test and a CI on the difference of variances directly from MIXED or GLIMMIX. I suppose you could bootstrap CIs. Or perhaps someone else in the Community has an idea.

This is an ambitious effort. Good luck!

Calcite | Level 5

## Re: Degrees of freedom in proc mixed

Thank you so much for the feedback. I can't say that I exactly understand at this point but I really appreciate the lead. I'll read more about it.

Discussion stats
• 4 replies
• 1192 views
• 0 likes
• 2 in conversation