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
- /
- SAS Programming
- /
- SAS Procedures
- /
- mixed model warning message

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

02-05-2013 04:21 PM

Hi, all,

I want to find out the correlation between two variables

(smoke and disease) by fitting a mixed model.

Here is my code:

**proc ****mixed** data=skin1;

class patient_id family_id smoke;

model disease=smoke/ htype=**3 **ddfm=bw s;

random patient_id(family_id);

**run**;

However, I got a warning message:

**WARNING: Stopped because of too many likelihood evaluations.**

And the output did not give me the p-value. How can I adjust the code to get the p-value? Thanks!

Accepted Solutions

Solution

02-06-2013
10:45 AM

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

Posted in reply to twotwotwo

02-06-2013 10:45 AM

To increase the number of likelihood evaluations (and most likely the number of likelihood iterations), you will need to add the following to the proc mixed line: maxiter=1000 maxfunc=5000. Those values should provide a good start.

There might be some other issues. First, what type of variable is disease? If it is binary, then proc mixed is not the right approach. Check the documentation for PROC GLIMMIX, to use a generalized mixed model. Second, are there multiple observations per patient_id? If there are, then the random statement is meaningful, but if there is only one observation per patient_id, then the random statement should most likely be replaced with:

random family_id;

If all of the issues I brought up are applicable (binary response, single obs per patient_id), I would use the following code:

proc glimmix data=skin1 method=quad;

class family_id smoke;

model disease=smoke/solution dist=binary;

random intercept/subject=family_id;

run;

Steve Denham

All Replies

Solution

02-06-2013
10:45 AM

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

Posted in reply to twotwotwo

02-06-2013 10:45 AM

To increase the number of likelihood evaluations (and most likely the number of likelihood iterations), you will need to add the following to the proc mixed line: maxiter=1000 maxfunc=5000. Those values should provide a good start.

There might be some other issues. First, what type of variable is disease? If it is binary, then proc mixed is not the right approach. Check the documentation for PROC GLIMMIX, to use a generalized mixed model. Second, are there multiple observations per patient_id? If there are, then the random statement is meaningful, but if there is only one observation per patient_id, then the random statement should most likely be replaced with:

random family_id;

If all of the issues I brought up are applicable (binary response, single obs per patient_id), I would use the following code:

proc glimmix data=skin1 method=quad;

class family_id smoke;

model disease=smoke/solution dist=binary;

random intercept/subject=family_id;

run;

Steve Denham

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

Posted in reply to SteveDenham

02-06-2013 02:57 PM

Hi, Steve,

Thanks for your reply! It really works for most of the cases. You are very right for most of the assumptions, except the binary response. I have either category response variable or continuous variables. This model works perfect for the category response variable, in which cases I set dist=mult. However, while I set dist=normal for the continuous variables, there is always some warning message pop out:

ERROR: Quadrature accuracy of 0.000100 could not be achieved with 31 points. The achieved accuracy was 0.001128.

Is there any way to solve this problem? Thank you very much!

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

Posted in reply to twotwotwo

02-06-2013 03:51 PM

Probably the best approach would be to change to the Laplace expansion, rather than using adaptive quadrature for the continuous variables. Change from method=quad to method=laplace, and see how things progress. If that doesn't work, we'll need to get into the options for quad, and that just seems messy to me.

What is going on is that GLIMMIX uses an adaptive quadrature algorithm to resolve an integral describing the likelihood, and it needs more support points for the interpolation. However, the number of points available depends a lot on the design and data, so rather than saying try method=quad(qmax=63) or method=quad(qmax=127) which would a) get around the problem of accuracy at the expense of b)greatly increased run time, I would drop back to the Laplace approximation.

Steve Denham

Message was edited by: Steve Denham

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

Posted in reply to SteveDenham

02-06-2013 04:01 PM

Hi, Steve,

Thanks a lot! It really works with the method=laplace.

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

Posted in reply to twotwotwo

02-07-2013 08:15 AM

Please vote me an answer thingy. Beg, beg, beg.

Steve Denham