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