Help with random effects in PROC MIXED

Reply
Occasional Contributor
Posts: 12

Help with random effects in PROC MIXED

Hi there,

I am using proc mixed for a longitudinal dataset. In the null model (aka the model with just household id in the class category and no covariates) the intercept in the random effects is 0. What does this mean? Am I doing something wrong? I am not getting error messages but wanted to compare the reduction in btwen and w/I group variance in my subsequent models with additional controls and cannot do this if it is zero to begin with. I can look at a reduction in AIC in each model but that still does not seem enough.

Thanks for any suggestions,

Naomi Lightman

OISE, University of Toronto

Contributor
Posts: 62

Re: Help with random effects in PROC MIXED

Hi,

Can you write your calss and model statement in PROC MIXED?

Occasional Contributor
Posts: 12

Re: Help with random effects in PROC MIXED

Hi Mohammad,

It's really basic and I've used before... everything else in the model looks normal to me besides the random effects intercept.

proc mixed data=lsic.transpose method=ml covtest;

  class householdid;

  model wage = householdid / s;

  repeated / type=un subject=householdid;

  run;

Contributor
Posts: 62

Re: Help with random effects in PROC MIXED

In mixed models we have :

Y = X*Beta + Z*Gamma + E

In your model , you don't have G-side (with random statement ) . It means you don't have  Z*Gamma.  The R-side effect is specified with repeated statement.

Respected Advisor
Posts: 2,655

Re: Help with random effects in PROC MIXED

What that zero says is that the repeated nature of the measurements accounts for all the variability, leaving none for the averaged effect of household_id.  This happens a fair amount if there is not enough data to support all of the covariance parameters specified using type=UN.  How many records, and how many covariance parameters are being estimated?

Steve Denham

Occasional Contributor
Posts: 12

Re: Help with random effects in PROC MIXED

Hi Steve,

Thanks for your response. I do have several thousand records (3 for each individual with a sample of over 2000 people) and as for covariance parameters - this is the model with ONLY household ID in it so there are no other variables included in the model. Is there anyone to change/adjust this?

Cheers, Naomi

Respected Advisor
Posts: 2,655

Re: Help with random effects in PROC MIXED

What I think is going on with the current model:  It is fitting household_id as both a subject effect and as a fixed effect.  After you remove the fixed effect variance under ML, there is nothing going on for repeated measures.  My problem is that I don't see this as fitting a repeated measures analysis.  If you have repeated measures on each household_id, you need to identify them somehow as an effect, and include it both in the model statement and in the repeated statement.  For instance, if each household_id was measured three times, or there were, say, three individuals in the household, then time or rep need to be included in the model.

Conversely, if you change the repeated statement to a random statement, and removed the type=un, it would give the variance component due to a random intercept for household_id, which is what I think you are trying for.

Steve Denham

Occasional Contributor
Posts: 12

Re: Help with random effects in PROC MIXED

Hi again and thank you very much for your help,

My syntax currently looks like this:

proc mixed noclprint noitprint data = lsic method = ml covtest;

class hhldid;

model wage = t / solution  ddfm = bw;

random intercept t/ sub = hhldid;

weight rescaledweight;

run;

However the intercept in the random effects is still 0!! Do you have any suggestions?

Thanks very much,

Naomi

Respected Advisor
Posts: 2,655

Re: Help with random effects in PROC MIXED

The random effects are fit from the most "complex" to the simplest, so the variance component due to t*hhldid explains all of the variance under the weighting scheme you have specified.  Note that the weight statement transforms both the X'X and Z'Z matrices to X'WX and Z'WZ, so there is a possibility that the scaled weight is such that it removes the variation due solely to household, but not due to household*t.

What is "t" in the model? It looks to be a continuous variable, such that you are doing a random regression.  Is that correct?  How many values does t take on, and what is the range?

Steve Denham

Occasional Contributor
Posts: 12

Re: Help with random effects in PROC MIXED

t is the variable for time. The dataset has three waves...

Occasional Contributor
Posts: 12

Re: Help with random effects in PROC MIXED

Should I use the original weight rather than the rescaled weight then?

Respected Advisor
Posts: 2,655

Re: Help with random effects in PROC MIXED

What is the weight, and how is it calculated, followed by how is the rescaled weight calculated?

(I have a feeling we may be dealing with survey data here, and we may need to shift procedures.  The answers to those questions will help clarify this.)

Steve Denham

Occasional Contributor
Posts: 12

Re: Help with random effects in PROC MIXED

It is survey data and is just rescaled to have a mean of 1. As I understand it, I cannot use the non-scaled weight for this data - better to use no weight.

Am I using the wrong procedure?

Respected Advisor
Posts: 2,655

Re: Help with random effects in PROC MIXED

PROC SURVEYREG may be much more applicable.  In particular, look at Examples 94.7 (Domain Analysis) and 94.8 (Comparing Domain Statistics).  With weights in hand, I think this is a better approach to your data.

Steve Denham

Contributor
Posts: 62

Re: Help with random effects in PROC MIXED

Also this presentation may help you : http://collaboratory.ucr.edu/files/glimmix.pdf

Ask a Question
Discussion stats
  • 14 replies
  • 423 views
  • 0 likes
  • 3 in conversation