BookmarkSubscribeRSS Feed
Tcook
Calcite | Level 5

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

7 REPLIES 7
ballardw
Super User

It looks like the variable LINP is not in your input data set NEW.

Tcook
Calcite | Level 5

Hi Ballardw,

yeah, its defined in the model.

ballardw
Super User

Mea culpa, is TIME in the input data set?

Tcook
Calcite | Level 5

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?

ballardw
Super User

Same or new error message? If a different message then log is going to be helpful.

Tcook
Calcite | Level 5

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.

ballardw
Super User

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-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!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 7 replies
  • 2817 views
  • 0 likes
  • 2 in conversation