🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 01-07-2010 03:32 AM
(22894 views)
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?
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Dale. That tip should save us a considerable amount of time and effort!