Programming the statistical procedures from SAS

Adjusted growing curves - repeated and multi trait model...PROGRAMING

Reply
Frequent Contributor
Posts: 103

Adjusted growing curves - repeated and multi trait model...PROGRAMING

Good night:

 

I am working in some groiwing models, and as you know there is an famous model called GOMPERTZ, well i'm trying to combine many informations containes in one data set, to obtain a the the weight estimates and dont use many outputs, just one.

 

My idea (i hope you to correct me) is compose just one comand with al the variables like this:

 

proc nlin data=have plots=all method=marquardt;
do;

parms a0 = 1 b0 = -0.5 = -0.25;
where age_in_days >= 0 and age_in_days <= 40;

end;

do;

parms a0 = 2 b0 = -2 = -0.5;
where age_in_days >= 40 and age_in_days <= 80;

end;

do;

parms a0 = 3 b0 = -4 = -1;
where age_in_days >= 80 and age_in_days <= 120;

end;

model weight_in_Kilograms=a0*exp(exp(b0)*(exp(b1*age_in_days)-1)/b1);
id sample;
output out=Estim p=pred r=resid parms=a0 b0 b1;
run;

 

Thank you so much

Respected Advisor
Posts: 2,655

Re: Adjusted growing curves - repeated and multi trait model...PROGRAMING

Again, this may be a simple one.  Make sure that you have initial values for all of the parameters.  In the code here, you have

 

parms a0 = 1 b0 = -0.5 = -0.25;

 

This will lead to problems.  I think you want:

 

parms a0 = 1 b0 = -0.5  b1= -0.25;

 

However, I'm still not sure if this will run.  You may need to embed macro code to get to the various sections.

But that still isn't my major concern.  This piecewise fitting will not yield a continuous growth curve, as you have no equations/variables designed to maintain the continuity.  And without them, it would be a stroke of luck if the model converged.  For an example of continuity based equations/variables, look at the first example in the PROC NLIN documentation (Segmented Model).  There are both continuity and smoothness conditions presented.  You will need to symbolically calculate the necessary additional variables and add them into the code to make this work.

 

Now if you have defined interventions at the time points, you could fit separate models,  

 

Steve Denham

Ask a Question
Discussion stats
  • 1 reply
  • 206 views
  • 0 likes
  • 2 in conversation