BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
er7212
Fluorite | Level 6

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
Rick_SAS
SAS Super FREQ

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. "

View solution in original post

4 REPLIES 4
Rick_SAS
SAS Super FREQ

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. "

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

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

 

image.png

Thanks again

Rick_SAS
SAS Super FREQ

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.)

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

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