Contributor
Posts: 33

# Covariance of variances mixed model

I have the following model:

Yijk = alpha_i + beta_j + gamma_ij + error_ijk

alpha= effect of the ith individual, (RANDOM)

beta = effect of the jth treatment, (FIXED)

gamma = interaction of individual and treatment (RANDOM)

i =1, 2, ...n ; j = 1, 2, ... m ; k = 1, 2, ...r

Individual i in the jth treatment is measured r times.

I have been trying to get the covariances of the variances of beta and gamma, beta and error, gamma and error. That is,

Cov(Varbeta,Vargamma)

Cov(Varbeta,Varerror)

Cov(Vargamma,Varerror)

Here is my current code. It outputs the asymptotic covariances of random effects and the covariance matrix for fixed effects BUT does not provide the above 3 covariances.

proc mixed data=sociodat  ASYCOV  covtest  METHOD=ML;

class trtment indiv;

model y = trtment/covb s;

random trtment trtment*indiv/G;

ods output CovParms=C;

run;

Best regards,

statz

Community Manager
Posts: 607

## Re: Covariance of variances mixed model

I moved your inquiry over to the SAS Statistical Procedures Community, where your question will be seen by more experts. Thank you for using SAS Online Communities! Hope to see more posts from you.

-
Bev Brown
Valued Guide
Posts: 684

## Re: Covariance of variances mixed model

ASYCOV is giving you the var-cov matrix of the var-cov parameters. So, you ARE getting the desired terms in the output. Square the SE for one of the estimated variances (in the Cov Param table) and you will get the diagonal variance of the matrix in the ASYCOV table. The off diagonal elements of the latter are the covariances, such as Cov(var_alpha,var_gamma).   However, your random term is not correct. Based on what you wrote, it should be

random indiv trtment*indiv / G;

Also, you need multiple observations within the treatment*individual combination for this to work, otherwise your model is overparameterized.

Contributor
Posts: 33

## Re: Covariance of variances mixed model

Thanks Ivm. I had a typo in my first message and I actually used the following in my code:

random indiv trtment*indiv / G;

Using asycov, I could get the var-cov matrix only for the random effects. I could not get those covariances related to the fixed and random effects, specifically

Cov(Varbeta,Vargamma)

Cov(Varbeta,Varerror)

Cov(Vargamma,Varerror)

Thanks,

Statz

Valued Guide
Posts: 684

## Re: Covariance of variances mixed model

I don't understand your question. There is no such thing as a covariance of a fixed effect with a random effect. A fixed effect is not a random variable, so there is no variance or covariance. That is, there is no Var_beta. Of course, there is a variance of the estimated betas, but this is a different concept. ASYCOV gives you the variance-covariance matrix of the estimated variance-covariance parameters only (var_alpha, and so on).

Discussion stats
• 4 replies
• 320 views
• 3 likes
• 3 in conversation