BookmarkSubscribeRSS Feed
Abbas_Arkawazi
Fluorite | Level 6

Hello,
I am working on fitting nonlinear mixed model to my data using proc nlmixed.
My model has four fixed effects & five random effects. 

But when I run the program, I get the following warning:

WARNING: The final Hessian matrix is full rank but has at least one
negative eigenvalue.
Second-order optimality condition violated.

Please help me solve this problem and guide me to the right way to solve this problem.

My code is the following and the data is in the attachment: 

proc import datafile='C:\Users\Abbas Arkawazi\Desktop\test.xlsx'
DBMS =xlsx Out=test;
run;
proc nlmixed data=test ;
parms b0=1 b1=2 b2=3 b3=4 a=2 b=1 aa=3 bb=1 s=100;
m =b0+(b1*age)+(b2*creatin)+(b3*gender);
y=urea;
if status_u=1 then f=((aa*bb*a*b)/s)*(exp(-b*exp((y-m)/s)))*((1-exp(-b*exp((y-m)/s)))**(a-1))*((((1-exp(-b*exp((y-m)/s)))**a)**(aa-1))/((1-((1-exp(-b*exp((y-m)/s)))**a))**(aa+1)))*((1+((((1-exp(-b*exp((y-m)/s)))**a)/(1-((1-exp(-b*exp((y-m)/s)))**a)))**aa))**(-bb-1)) ;
else f= 1-((1+(((1-exp(-b*exp((y-m)/s)))**a)/(1-(1-exp(-b*exp((y-m)/s)))**a))**aa)**-bb) ;
ll=log(f);
model y ~ general(ll);
run;

 

3 REPLIES 3
mkeintz
PROC Star

"Final Hessian"

 

Somebody should take that as a username.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
SteveDenham
Jade | Level 19

If the Hessian is full rank with a negative eigenvalue, you have two options.  One is to use a simpler model, the other is to find out which line of data (or lines) lead to the problem.  You could use a pseudo-jackknife approach to the latter, fitting the model while successively deleting a single observation.  If all of the reduced datasets lead to the same issue, then it is almost certainly a misspecification of the model issue.

 

SteveDenham

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1594 views
  • 4 likes
  • 4 in conversation