BookmarkSubscribeRSS Feed
rizayuli
Calcite | Level 5

please help me to explain my syntax.

data fish;
input count x1 x2 x3 x4; 
cards;
0 83.74 54.98 80.53 1.96
0 76.36 18.45 51.33 0.3
3 76.29 56.16 70.95 1.93
0 79.32 40.94 75.68 1.34
2 95.77 87.68 83.12 1.36
1 69.27 76.85 46.16 0.71
0 93.02 58.56 89.01 0.87
0 94.42 50.06 91.5 1.55
1 98.93 91.2 97.6 3.71
0 84.4 62.04 79.87 1.56
1 98.71 50.72 97.11 1.07
0 93.31 93.5 86.73 0.81
0 100.06 76.08 98.36 4.14
0 80.71 76.57 77.14 2
21 100.41 79.48 97.81 21.62
12 90.09 73.14 82.95 1.66
0 100.32 67.6 74.45 4.48
0 95.82 84.82 93.94 1.3
0 41.92 24.11 39.17 0.62
5 75.03 46.2 72.53 1.79
2 81 38.01 78.63 0.4
0 83.05 46.8 80.6 0.73
0 90.44 25.15 82.14 1.07
0 75.45 45.28 70.81 0.21
0 51.9 63.07 41.18 1.55
1 10.51 56.22 10.14 0.55
1 77.22 54.04 74.28 1.12
0 71.46 81.42 63.99 0.43
0 73.56 51.57 69.7 0.78
2 44.69 72.74 42.6 3.32
0 51.02 59.02 47.2 0.94
0 20.4 36.19 18.55 2.13
1 14.95 1.04 9.63 0.03
;
data fish;
set fish;
bound=1;
if count > bound then count=bound+1; * This is probably
how you would see the data if it was actually censored;
proc nlmixed TECH=NRRIDG; *untuk variabel KN1 TT2+ KNL TT5;
parms a0=0 a1=0 a2=0 a3=0 a4=0 b0=0 b1=0 b2=0 b3=0 b4=0 alpha=0.5;
bounds alpha>0;
lin = a0 + a1*x1 + a2*x2 + a3*x3 + a4*x4;
w = exp(lin)/(1+exp(lin));
eta = b0 + b1*x1 + b2*x2 + b3*x3 + b4*x4;
mu = exp(eta);
phi=1/alpha;
pdf=(gamma(count+phi)/(gamma(count+1)*gamma(phi)))
*((1/(1+alpha*mu))**phi*(alpha*mu/(1+alpha*mu))** count);
l_1 = w;
l_2 = (1-w) * pdf / (1-(1+alpha*mu)**(-phi));
cdf=0;
do t=1 to bound;
cdf=cdf+((1-w)*((gamma(t+phi)/(gamma(t+1)*gamma(phi)))
*((1/(1+alpha*mu))**phi*(alpha*mu/(1+alpha*mu))**t)/(1-(1+alpha*mu)**(-phi))));
end;
l_3= 1-cdf;
if count = 0 then ll = log(l_1);
if 0 < count <= bound then ll = log(l_2);
if count <= bound then d=0; else d=1;
ll=(1-d)*ll+d*log(l_3);
model count~general(ll);
run;

 

but there is warning:


NOTE: GCONV convergence criterion satisfied.
NOTE: At least one element of the (projected) gradient is greater than 1e-3.
WARNING: The final Hessian matrix is full rank but has at least one negative eigenvalue. Second-order
optimality condition violated.
NOTE: PROCEDURE NLMIXED used (Total process time):
real time 0.28 seconds
cpu time 0.26 seconds

1 REPLY 1
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Google can be your friend here: just search using the text of the error message.

 

If you Google "The final Hessian matrix is full rank but has at least one negative eigenvalue", you find these links:

 

http://tinyurl.com/z7s4q4g

 

http://tinyurl.com/gorokea

 

Another useful resource is this paper

 

https://support.sas.com/resources/papers/proceedings15/SAS1919-2015.pdf

 

Hopefully one of these will suggest a solution for your problem. Good luck!

 

Edited: Also, if you would provide a description of your study and and your model, someone on the list might be able to help you assess whether you have a correct model.

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
  • 1 reply
  • 2626 views
  • 0 likes
  • 2 in conversation