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
- /
- Sas proc mixed - Repeated measures random effects

Topic Options

- 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

3 weeks ago

I have a dataset in this format:

Factor A is a between subject factor (with 2 levels - High and Low).

Factor B is a within subject factor (with 3 levels - High , Moderate and Low).

I want to run a mixed model with nested random effects factor.

The code that I am using is:

```
proc mixed data=data.mydata;
class FactorA FactorB;
model DV = FactorA|FactorB;
random FactorB(FactorA) FactorB*FactorA(FactorA);
lsmeans FactorA|FactorB;
run;
```

The log states: **Estimated G matrix is not positive definite.**

I also do not get any of the p-values (only a '.' is displayed).

Furthermore in the output tables, I see that DF = 0. I have a hunch that this is what is symptomatic of the error. But I have been unable to figure out why this is happening. Any leads will be appreciated. Thanks.

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

Posted in reply to stanmarciano

3 weeks ago

It is important, I'd say critical, to distinguish between fixed effects factors (like your Factors A and B) and random effects factors (like ID). The novice mixed modeler often sees Factor A and ID as being the same thing and serving the same purpose in the specification of the model. But they are not the same thing--which is easy to see when you consider Factor A as having 2 levels, and factor ID as having (2 times the number of replications) levels; if nothing else, factors with different levels are different factors. Clarity in your thinking will lead to clarity in your model. I highly recommend studying SAS® for Mixed Models, Second Edition.

Meanwhile, if your design is a split-plot design, consider this code:

```
proc mixed data=data.mydata;
class FactorA FactorB ID;
model DV = FactorA|FactorB;
random ID(FactorA);
lsmeans FactorA|FactorB;
run;
```

I hope this helps.

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

3 weeks ago

It does. Thank you so much.