BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
twotwotwo
Calcite | Level 5

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!

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

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

5 REPLIES 5
SteveDenham
Jade | Level 19

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

twotwotwo
Calcite | Level 5


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!

SteveDenham
Jade | Level 19

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

twotwotwo
Calcite | Level 5


Hi, Steve,

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

SteveDenham
Jade | Level 19

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

Steve Denham

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 10149 views
  • 7 likes
  • 2 in conversation