Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- Help with random effects in PROC MIXED

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-03-2013 12:31 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to naomi_lightman

12-03-2013 02:53 PM

Hi,

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to MohammadFayaz

12-03-2013 03:00 PM

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;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to naomi_lightman

12-03-2013 03:13 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to naomi_lightman

12-04-2013 08:32 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

12-04-2013 08:39 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to naomi_lightman

12-04-2013 08:49 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

12-16-2013 05:59 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to naomi_lightman

12-17-2013 01:15 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

12-17-2013 01:24 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

12-17-2013 01:25 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to naomi_lightman

12-17-2013 02:49 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

12-17-2013 09:37 PM

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?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to naomi_lightman

12-18-2013 01:08 PM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to naomi_lightman

12-03-2013 03:31 PM

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