Programming the statistical procedures from SAS

Manually calculate GCorr

Accepted Solution Solved
Reply
Contributor
Posts: 24
Accepted Solution

Manually calculate GCorr

Hello,

 

I need some help with the G and GCorr matrix in generalized linear mixed models. I thought it was the covariance and the correlation matrix of the random effects. However, when I use proc corr to calculate the correlation between the estimated random effects given in the output table solutionR, I get different results from the output table GCorr? BTW, I have already taken into account the grouping variable.

 

Do you have any hint for me what went wrong?

Thanks in advance + regards,

M


Accepted Solutions
Solution
‎09-02-2016 02:46 AM
SAS Super FREQ
Posts: 3,540

Re: Manually calculate GCorr

This is a common misconception.  If you look at the doc that discusses mixed model theory, you will see that the random effects are generated by a matrix G. What you are seeing is an estimate of this matrix.

 

In general, correlation matrices that get printed as part of regression model are the correlation of the PARAMETERS (coefficients) in the model. In many cases, you can show that the sampling distribution of the parameter estimates is multivariate normal. These matrices estimate the parameters in the sampling distribution. The blog post "Simulate many samples from a logistic model" shows a similar situation for fixed effects in a logistic model.  It simulates many data sets and estimates the regression coefficients for each sample. It then displays a scatter plot of the estimates. You can see that the estimates are correlated.

View solution in original post


All Replies
Solution
‎09-02-2016 02:46 AM
SAS Super FREQ
Posts: 3,540

Re: Manually calculate GCorr

This is a common misconception.  If you look at the doc that discusses mixed model theory, you will see that the random effects are generated by a matrix G. What you are seeing is an estimate of this matrix.

 

In general, correlation matrices that get printed as part of regression model are the correlation of the PARAMETERS (coefficients) in the model. In many cases, you can show that the sampling distribution of the parameter estimates is multivariate normal. These matrices estimate the parameters in the sampling distribution. The blog post "Simulate many samples from a logistic model" shows a similar situation for fixed effects in a logistic model.  It simulates many data sets and estimates the regression coefficients for each sample. It then displays a scatter plot of the estimates. You can see that the estimates are correlated.

Valued Guide
Valued Guide
Posts: 684

Re: Manually calculate GCorr

[ Edited ]

Also note: G is the covariance matrix of the (unknown) random effects in the model (gamma). G is not the covariance matrix of the estimated (really predicted) random effects in the model (gamma^). 

 

Adding to the complexity, as indicated by Rick, what you get from the output is G^, the estimated covariance matrix of the (unknown) random effects. G^ is not the estimated covariance matrix of the estimated (predicted) random effects.

Contributor
Posts: 24

Re: Manually calculate GCorr

Rick and Ivm, thank you for the helpful clarification!

But then, do I have any chance to get the (co)variance of the reference category of a random effect (3 unordered categories) that follows a multinomial distribution? If I don't choose the largest category as reference in my GLMM, the model does not converge. However if I do so, the G Matrix only contains the blocks of (co)variances for non-reference categories and of course, the (co)variance of the largest category is of main interest.

 

Thanks again!

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 238 views
  • 5 likes
  • 3 in conversation