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.
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. "
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. "
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
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.)
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.