0
$\begingroup$

I am working on a program in SAS that seeks to extract r2 based on the residual variance produced by covariance parameter estimates in PROC MIXED.

The specification of the covariance structure was previously specified as unstructured, because AIC comparisons and case studies determined it was the best fit. The problem is that a residual variance estimate is not produced when I specify the covariance structure as type=un (unstructured). A snippet of the code is below.

 proc mixed data=unidata method=ml;
  class SUBNUM drugcode time;
  model y= baselinescore  DRUGCODEN time  time*drugcode/solution cl;
  repeated time /subject=SUBNUM type=un r rcorr;

When we initially looked at covariance structures for this data, it came down to unstructured and autoregressive covariance structures; they had the lowest AICs and best described the within-subject correlation in the repeated measurements design. AR(1) actually scored slightly better on AIC. I suspect that TYPE=UN was specified for this data mainly due to convention and the fact that the difference between AR(1) and UN covariance structures had minimal effect on the model results.

But now that we need to extract r2 from the model, it's hard to determine why the unstructured covariance provides no residual variance estimates, while AR(1) structure does provide an estimate. Is something wrong with my code that is resulting in no residuals under Covariance Parameter Estimates, or is it because of the covariance structure I specified?

Many thanks for reading and any guidance.

$\endgroup$
2
  • 1
    $\begingroup$ With AR(1), there is a single variance parameter that multiplies the autocorrelation matrix to give you the covariance matrix. Notice that the diagonals are all equal to this number. With an unstructured covariance matrix, the diagonal elements are all different numbers, ie, there are different variances. Thus there is not one single number that you can identify to be the residual variance. $\endgroup$ Jul 18 at 12:12
  • 1
    $\begingroup$ Thanks for your answer, that helps. How might you go about assessing the best fit in this case, given that the AICs are similar (AR (1) is slightly lower), the results are not significantly affected, but residual variance is needed to calculate an f2? Since the unstructured covariance matrix can't provide a the residual variance, it seems I may need to re-do all the analyses with AR(1) instead. Can you comment on any other implications? Many thanks again. $\endgroup$
    – Jen A.
    Jul 18 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.