Hi All,
I am trying to fit a frailty model for recurrent event time in SAS using the proc nlmixed procedure. I have 8 categorical variable, with the highest having 9 categories while the least has just two categories, with also with continues variable.
Variables:Tip ( 2 levels), sup1(3 levels), period(5 levels), red(2 levels), upperb(2 levels), wc(9 levels), name1( 2 levels), trapname1(3 levels), while shade and shade2 are continuous variable.
Below is the sas code and the error message generated.
Title "Frailty Gamma Model ";
ods output ParameterEstimates=Est;
proc nlmixed data=new qpoints=50 noad;
bounds gamma > 0;
linp = b0 + b1*(tip1) - b2*(sup1)- b3*(sup2) +b4*(period1) + b5*(period2)-b6*(period3)-b7*(period4)+
b8*(red)-b9*(upperb)+b10*(wc1)+c1*(wc2)+ c2*(wc3)+ c3*(wc4)+ c4*(wc5)+ c5*(wc6)+
c6*(wc7)+ c7*(wc8)+ c8*(name1)-
c9*(trapname1)-c10*(trapname2)-d1*(shade)+d2*(shade2)+ z;
alpha = exp(-linp);
G_t = exp(-(alpha*time1_cum)**gamma);
g = gamma*alpha*((alpha*time1_cum)**(gamma-1))*G_t;
ll = (status=1)*log(g) + (status=0)*log(G_t);
model time ~ general(ll);
random z ~ normal(0,exp(2*logsig)) subject=pie_id out=EB;
predict 1-G_t out=cdf;
run;
The error message is below;
60
61 ods output ParameterEstimates=est;
NOTE: Writing HTML Body file: sashtml.htm
62 proc nlmixed data=new qpoints=50 noad;
63 bounds gamma > 0;
64 linp = b0 + b1*(tip1) - b2*(sup1)- b3*(sup12) +b4*(period1) +
64 ! b5*(period2)-b6*(period3)-b7*(period4)+
65 b8*(red)-b9*(upperb)+b10*(wc1)+c1*(wc2)+ c2*(wc3)+ c3*(wc4)+ c4*(wc5)+ c5*(wc6)+
NOTE: Character value converted to numeric for argument 2 of '*' operation at line 65 column 3.
NOTE: Character value converted to numeric for argument 2 of '*' operation at line 65 column 15.
66 c6*(wc7)+ c7*(wc8)+ c8*(name1)-
67 c9*(trapname1)-c10*(trapname2)-d1*(shade)+d2*(shade2)+ z;
68 alpha = exp(-linp);
69 G_t = exp(-(alpha*time1_cum)**gamma);
70 g = gamma*alpha*((alpha*time1_cum)**(gamma-1))*G_t;
71 ll = (status=1)*log(g) + (status=0)*log(G_t);
72 model time ~ general(ll);
73 random z ~ normal(0,exp(2*logsig)) subject=pie_id out=EB;
74 predict 1-G_t out=cdf;
75 run;
NOTE: To assign starting values to parameters, use the PARMS statement. The default starting value
of 1.0 is in effect for all parameters.
ERROR: Dependent variable is not in the input data set.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.EB may be incomplete. When this step was stopped there were 0
observations and 0 variables.
WARNING: The data set WORK.CDF may be incomplete. When this step was stopped there were 0
observations and 0 variables.
NOTE: PROCEDURE NLMIXED used (Total process time):
real time 1.34 seconds
cpu time 0.04 seconds
Please I would appreciate if anyone could have a look at it and tell how to go about resolving it.
Thanks in advance.
Cook
It looks like the variable LINP is not in your input data set NEW.
Hi Ballardw,
yeah, its defined in the model.
Mea culpa, is TIME in the input data set?
Ballardw, it is actually time1_cum, I have corrected that but still having trouble running the model. Please do you have an idea of what might have gone wrong?
Same or new error message? If a different message then log is going to be helpful.
I was able to resolve the initial problem but after running the nlmixed model for a weilbull frailty model, I realized that no standard error estimates were generated for the intercept and one other parameter in the models. Secondly I got the following warning message
WARNING: The final Hessian matrix is full rank but has at least one negative eigenvalue. Second-order
optimality condition violated
I will greatly appreciate it if anyone has an idea of what the problem might be and suggestion on how I should go about resolving it.
Thanks.
I suggest you start a new thread with a title something like "No standard error for intercept in NLMIXED" in the Statistics group instead of health care as it may get more attention there.
And with the error resolved for this one mark it answered, even if you found the resolution on your own.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.