BookmarkSubscribeRSS Feed
zana
Calcite | Level 5

Merry Christmas!

Dear all,

I have a data set like this;

ID Sex Age Weight

1    F    10      20

1    F    22      60

2    M    9       15

2    M   18      54

How can i estimate parameters (by Nlmixed procedure) of the growth models (e.g, Brody function) for each ID in different ages?


The Brody function is:

y=a[1- {b*exp(-k*t)}]+e

y=observation (Weight)

exp=natural logarithms

t=Age

e= Residual


I used SAS9.1.3., could anyone please help me?

Best regards.

Zana

12 REPLIES 12
SteveDenham
Jade | Level 19

One method that should work is to add a BY statement to PROC NLMIXED.  An example is BY ID;.  Be sure to sort the data by ID in a PROC SORT first.

Steve Denham

zana
Calcite | Level 5

Thanks dear Steve,

I try by this:

data have;

input id sex$ age weight;

cards;

1    F    10      20

1    F    22      60

2    M    9       15

2    M   18      54

;

proc nlmixed data=have;

by id;

parms a=60 b=5 k=0.5 s2e=1 s2u=10;

ex=exp(-k*age);

num=(a*(1-(b*ex)))+u;

model weight~normal(num,s2e);

random u ~ normal(0,s2u) subject=id;

predict num out=output_fixed;

run;

Is it true (please assume weight has a normal distribution)? However, when i run this program i can't found any parameters in the output file (output_fixed). I need a program that estimate all parameters (A, B & K) for each ID in each age.

Please check my program and let me i have your idea.

Best regards

Zana

SteveDenham
Jade | Level 19

One big problem here--you are trying to fit a three parameter model with only two points.  It cannot be done.

Your program will also run into the problem of single subjects to estimate the random effect.

I believe you need to remove the BY ID statement to get the random effect to properly be applied.

NOTE WELL: You cannot get the parameters estimated separately for each ID if you consider ID to be the subject of a random effect. What you are estimating in NLMIXED are population parameters, where the population is that represented by the subjects measured.

If you wish to get these three parameters for each ID, I suggest that there be at least 4 ages for each ID.  You should also consider shifting to PROC NLIN, and fitting as follows:

proc nlin data=have;

by id;

parms a=60 b=5 k=0.5 ;

ex=exp(-k*age);

num=(a*(1-(b*ex)));

model weight=num;

output out=output_fixed/parms=(a b k); /* You may have to try different versions here, with commas for instance */

run;

What is absolutely key though is having more datapoints than parameters in the model.

Steve Denham

zana
Calcite | Level 5

Thanks a lot for your reply! Can i have a reliable scientific source for this key (having more datapoints than parameters in the model)?

Dear Steve i have a more question, is there a way to estimation of each parameters for each ID in different age (by Nlmixed, NLIN or each other procedure)?


Best regards,

Zana

SteveDenham
Jade | Level 19

Zana,

Any basic statistics text on regression will point out that you must have more data points than parameters you are estimating.  An excellent book would be Applied Regression Analysis, 2nd ed. by Draper and Smith, or REGRESSION MODELING STRATEGIES with Applications to Linear Models, Logistic Regression, and Survival Analysis by FE Harrell.  For a strictly non-linear approach, try Nonlinear Statistical Models by Ron Gallant.

So on to your final question--with only one point per ID per age, how could you possibly fit a model of any sort?  There are an infinite number of triples (a,b,K) that will yield a single value.

Steve Denham


zana
Calcite | Level 5

Data points per each ID?

Is't critical?


If i could understand you, there is no any way to estimate parameters for each age. Is it true?

Best regards

Zana

SteveDenham
Jade | Level 19

That is true.  Your function predicts weight from age.  If age does not vary, then the function cannot be applied.

I really recommend that you look over the references I provided so that you can firm up your knowledge of regression.

Steve Denham

zana
Calcite | Level 5

Dear Steve, thank you so much. I try study your references.

I have a more question: i should used a random effect in all growth models (e.g., Brody, Gompertz, Logistic, Richards & ...). I can't found this effect (random effect symbol) in each of these growth models. Do you have any idea or suitable reference about this?

Thanks again

Zana

SteveDenham
Jade | Level 19

Zana,

That is an interesting and complicated question.  It depends on which parameters in the given growth model you believe come from a distribution typified by the subjects measured, and which other parameters are to be considered fixed for all members of the population.  For an example, check out the Getting Started example in PROC NLMIXED where a logistic growth curve is fit.  Parameter b1 is assumed to come from a distribution with mean = 190 and variance = 1000 (starting assumption), while parameters b2 and b3 are assumed to be fixed across all members.  The short answer is that the researcher has to decide.

Steve Denham

zana
Calcite | Level 5

Thank you so much, really you are fabulous.

Thanks again.

Zana

zana
Calcite | Level 5

Dear Steve, sorry for wasting your time.

Please assume for our data the parameter A is more different between subjects. So, can i change the above function as fallows?

 

proc nlmixed data=have;

parms a=60 b=5 k=0.5 s2e=1 s2u=10;

ex=exp(-k*age);

num=((a+u)*(1-(b*ex)));

model weight~normal(num,s2e);

random u ~ normal(0,s2u) subject=id;

predict num out=output_fixed;

run;


Zana

SteveDenham
Jade | Level 19

That would be a very good approach.

Steve Denham

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!

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
  • 12 replies
  • 2601 views
  • 2 likes
  • 2 in conversation