Programming the statistical procedures from SAS

Help with Proc Mixed Specification and Modeling

Occasional Contributor
Posts: 9

Help with Proc Mixed Specification and Modeling

I am running multivariate multilevel growth model in SAS with two random components (one for intercept and one for slope) on > 4000 subjects each measured 10 times or more. I have two or more dependent variables (DV). My data are structured as follows in which med is the dummy for two DVs, listed as Ys :

id       med   Y     t    t1   age

1          x     70    1   11   45

1          x     34    2   12   45

1          x     54    3   13   45

1          y     45    1   21   45

1          y     34    2   22   45

1          y     56    3   23   45

2          x     70    1   11   66

2          x     39    2   12   66

2          x     59    3   13   66

2          y     45    1   21   66

2          y     64    2   22   66

2          y     46    3   23   66



I want to estimate the following variance structures

G Matrix                                            R Matrix

int(x)       U1                                         t11      r1

int(x)       U2  U3                                   t12      r2   r3

slope(x)   U4  U5  U6                             t13      r4   r5   r6

slope(y)   U7  U8  U9   U10                    t21      r7   r8   r9  r10 

                                                            t22      r11   r12   r13  r14   r15  

                                                            t23      r16   r17   r18  r19   r20   r21 

* Growth model SAS code;

proc mixed data=mult  covtest asycorr noclprint;

class med t1;

model y= med t age med*t med*age /noint s ddfm=kr;

random med med*t / type=un sub=id g gcorr;

repeated t1 / type=un subject=id r rcorr; 


This model runs error.  The 'infinite likelihood' problem is gone if a dummy of med by t (i.e., t1) is used.  However, I have the following issues.

If type=un is used on the repeated statement it warns of nonpositive definite;  covariance or variance estimates involving random slopes are nearly zero or too small. If  un(1) on repeated, it provides "Asymptotic variance matrix of covariance parameter estimates has been found to be singular...." It runs only when '  / type=vc ...' is specified on the repeated statement.  I have tried dropping either random or repeated statement and it works but not when both stay on.

Where is the issue? How can I correctly estimate the G-matrix and R-matrix as specified above? Please help.  

d model

Respected Advisor
Posts: 2,655

Re: Help with Proc Mixed Specification and Modeling

The two variables t1 and med*t are exactly equivalent, and fitting them as both R and G side is what is causing the NPD problem.  Try dropping the repeated statement (for now) and see how many covariance parameters are estimated.  You might also try rewriting the random statement as:

random intercept t/type=un sub=id*med g gcorr;

as this is exactly equivalent to your current random statement. It should make the intercept and slope parts more apparent as well.

You may wish to consider this as a doubly repeated measures design--once for med, and then for time.  Check the documentation for the Kronecker product covariance structures, such as UN@UN.

With this you could fit:

proc mixed data=mult  covtest asycorr noclprint;

class med t;

model y= med t age med*t med*age /noint s ddfm=kr;

repeated med t / type=un@un subject=id r rcorr; 


Unforturnately, I don't know if this will address your research question quite as directly as what you propose.

Steve Denham

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation