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
- /
- Mixed Model, Nested ANCOVA with Random Coefficient...

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

12-10-2012 05:34 PM

Suppose I have two factors, call them Factor1 and Factor2. Factor1 is fixed with two levels, call them A and B. Factor2 is random with three levels and is nested within Factor1. For each level of factor2(factor1) my data set has about 100 observations, including a covariate and the continuous response variable. Conceptually, a simple linear model exist for each level of factor2(factor1). The levels of factor2(factor1) appear to have unequal slope and unequal intercept parameters. First, I need to determine whether or not the average of the slope parameters for level A is significantly different from the average of the slope parameters for level B. If there is no significant difference between the average slope parameters, then I would also like to test for significant differences between intercepts of the two levels. Does anyone have any ideas on how to set up this problem, preferably with PROC MIXED?

Thanks in advance.

Accepted Solutions

Solution

12-12-2012
07:57 AM

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

12-12-2012 07:57 AM

This looks right To speed processing, etc., you may want to change the random statement to take advantage of subject specification:

random intercept covariate/subject=factor2(factor1) solution;

Steve Denham

All Replies

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

12-11-2012 08:42 AM

I may be misunderstanding your design because I think your random factor2 has the same levels across all levels of factor1, so is not truly nested, but you could try (syntax is for SAS/STAT12.1):

proc mixed data=yourdata;

class factor1 factor2 id;

model response = factor1 covariate factor1*covariate/solution ddfm=kr2;

random factor2/subject=id;

run;

The Type 3 F tests are essentially for slopes and intercepts: factor1*covariate tests whether the slopes differ for the levels of factor1, while factor1 tests whether the intercepts differ. If you have access to SAS for Mixed Models, 2nd.ed. by Littell et al., check the sections on analysis of covariance.

Steve Denham

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

12-11-2012 08:47 PM

Thanks so much for your helpful response. You said that the syntax is for SAS/STAT 12.1. Unfortunately, I'm still stuck in SAS 9.1.

The levels of factor2 are not the same for every level of factor1, so the design is nested.

I thought about the problem some more today and came up with the following PROC MIXED step that I think does the trick. Using this model, there is both a fixed and a random component to the slopes and intercepts. However, I've never seen a model quite like this and I'm operating a bit outside of my comfort zone. Does what I'm doing make sense?

proc mixed data=mydata;

class factor1 factor2;

model response=factor1 covariate*factor1/noint solution;

random factor2(factor1) covariate*factor2(factor1)/solution;

estimate "Intercepts: Level A - Level B" factor1 1 -1;

estimate "Slopes: Level A - Level B" covariate*factor1 1 -1;

quit;

Thanks again.

Solution

12-12-2012
07:57 AM

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

12-12-2012 07:57 AM

This looks right To speed processing, etc., you may want to change the random statement to take advantage of subject specification:

random intercept covariate/subject=factor2(factor1) solution;

Steve Denham

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

12-12-2012 05:18 PM

Thanks so much. This has been a big help. Your RANDOM statement did speed processing considerably. I also added the TYPE=FA0(2) option to the RANDOM statement because I came across an example that recommended this covariance structure (or TYPE=UN) for random coefficient models.