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;
"Final Hessian"
Somebody should take that as a username.
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.