Fluorite | Level 6

## prox mixed Example 79.5 Random Coefficients

Hello all

I am new to PROC MIXED and having a trouble understanding SAS Doc Example (Example 79.5 Random Coefficients) as referenced here. So in the first part of the example, we fit the following random intercept/slope model to the RC data with 'Batch' as the grouping (clustering) element:

```proc mixed data=rc;
class Batch;
model Y = Month / s;
random Int Month / type=un sub=Batch s;
run;```

And based on Output 79.5.3, we have 2 columns per each subject which translates to 6 random effects that are related to each other with a full unstructured format. This means that the G matrix is 6 by 6 and all of 36 elements are parameters to be estimated. But later on, when I look at Output 79.5.5, I can only find 4 of those estimates. So the question is what happened to other G parameter estimates and how I can retrieve those?

Appreciate any words of wisdom anyone could share.

1 ACCEPTED SOLUTION

Accepted Solutions
SAS Super FREQ

## Re: prox mixed Example 79.5 Random Coefficients

Output 79.5.8 shows the estimated slope and intercept for each of the three subjects. The G matrix is 2x2. Since G is symmetric, that implies 3 parameters for the unstructured covariance matrix. Reread the paragraph that begins "The two random effects are `Int` and `Month," `which includes the sentence, "In mixed model notation, G is block diagonal with unstructured 2x2 blocks. "

4 REPLIES 4
SAS Super FREQ

## Re: prox mixed Example 79.5 Random Coefficients

Output 79.5.8 shows the estimated slope and intercept for each of the three subjects. The G matrix is 2x2. Since G is symmetric, that implies 3 parameters for the unstructured covariance matrix. Reread the paragraph that begins "The two random effects are `Int` and `Month," `which includes the sentence, "In mixed model notation, G is block diagonal with unstructured 2x2 blocks. "

Fluorite | Level 6

## Re: prox mixed Example 79.5 Random Coefficients

Thanks much, it indeed helps out.
Fluorite | Level 6

## Re: prox mixed Example 79.5 Random Coefficients

Is there any way to extract the full G matrix when we specify SUBJECT= option?

In reading the document as referenced here, it mentions "If you specify the SUBJECT= option, then the block of the matrix corresponding to the first subject is displayed".

However I'd like to see the full G matrix for all blocks (even though if they might be identical which in this example because of TYPE=UN, I think that's not the case). A use case I am following is to fully reproduce "Solution for Random Effects" estimates (gamma hat) as defined by

Thanks again

SAS Super FREQ

## Re: prox mixed Example 79.5 Random Coefficients

The "full matrix" is block-diagonal. You can use the BLOCK function in SAS/IML (a matrix language) to construct block-diagonal matrices. An example is shown in the article "Constructing block matrices with applications to mixed models."

You can also use the MMEQ and MMEQSOL options to get the matrix expression for the mixed model equations. (Not sure if this last solution is relevant to your case.)

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