Help using Base SAS procedures

mixed model warning message

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

mixed model warning message

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
Respected Advisor
Posts: 2,655

Re: mixed model warning message

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

View solution in original post


All Replies
Solution
‎02-06-2013 10:45 AM
Respected Advisor
Posts: 2,655

Re: mixed model warning message

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

Contributor
Posts: 20

Re: mixed model warning message


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!

Respected Advisor
Posts: 2,655

Re: mixed model warning message

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

Contributor
Posts: 20

Re: mixed model warning message


Hi, Steve,

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

Respected Advisor
Posts: 2,655

Re: mixed model warning message

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

Steve Denham

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 2351 views
  • 6 likes
  • 2 in conversation