turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Nested random effects in proc mixed

Topic Options

- Subscribe to 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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-07-2010 03:32 AM

I want to set up a nested four-level model in proc mixed, say repeated observations within persons within classes within schools. How do I formulate this nesting? Ideally I would do something like:

random school;

random class(school);

"random person(class(school))";

but how to specify this last level?

random school;

random class(school);

"random person(class(school))";

but how to specify this last level?

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

01-07-2010 03:55 PM

I posted a similar thread a few months ago but never got a response. My best guess is

random person(class school);

random person(class school);

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

01-11-2010 08:06 AM

Either

random person(class school)

or

random person(class*school)

will work.

random person(class school)

or

random person(class*school)

will work.

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

01-11-2010 03:56 PM

The person-specific random effect can be equivalently specified employing a REPEATED statement. Note that the MIXED documentation states with regard to computational issues that "In general, specify random effects with a lot of levels in the REPEATED statement and those with a few levels in the RANDOM statement."

It is well known that a random intercept model results in a within-subject compound symmetric residual covariance structure. Thus, using the advice to employ a REPEATED statement in place of the RANDOM statement, you would want to construct the REPEATED statement to specify TYPE=CS covariance structure.

The MIXED documentation also states "If possible, "'actor out' a common effect from the effects in the RANDOM statement and make it the SUBJECT= effect. This creates a block-diagonal G matrix and can often speed calculations."

Following the above cited recommendations, I would employ the following RANDOM/REPEATED statements:

random intercept / subject=school;

random intercept / subject=class(school);

repeated / subject=person(class*school) type=cs;

The repeated statement can be specified with or without the asterisk between class and school.

It is well known that a random intercept model results in a within-subject compound symmetric residual covariance structure. Thus, using the advice to employ a REPEATED statement in place of the RANDOM statement, you would want to construct the REPEATED statement to specify TYPE=CS covariance structure.

The MIXED documentation also states "If possible, "'actor out' a common effect from the effects in the RANDOM statement and make it the SUBJECT= effect. This creates a block-diagonal G matrix and can often speed calculations."

Following the above cited recommendations, I would employ the following RANDOM/REPEATED statements:

random intercept / subject=school;

random intercept / subject=class(school);

repeated / subject=person(class*school) type=cs;

The repeated statement can be specified with or without the asterisk between class and school.

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

01-12-2010 08:00 AM

Thanks, Dale. That tip should save us a considerable amount of time and effort!