BookmarkSubscribeRSS Feed
zana
Calcite | Level 5

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

I'm trying to estimate a Brody growth function parameters (a,b and k) using nlmixed procedure;

How can i estimate Brody parameters for each sex, and how can i found significantly difference or non-significantly between them for each of the parameters?

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 with that?

Thanks alot.

Zana

6 REPLIES 6
JacobSimonsen
Barite | Level 11

You can do something like this:

proc nlmixed data=mydata ;

  parms amu=72, bmu=2.5, kmu=0.15,asigma=0.2,bsigma=0.02,ksigma=0.02,difa=0,difb=0,difk=0,error=0.1;

  bounds amu>0,bmu>0,kmu>0,error>0,asigma>0,bsigma>0,ksigma>0;

  mean=a*(1- (b*exp(-k*age)));

  model weight~normal(mean,error);

  random a b k ~ normal ([amu+sex*difa,bmu+sex*difb,kmu+sex*difk],[asigma,0,bsigma,0,0,ksigma]) subject=id;

run;

Here I assume that a,b and k is normal distrubuted with same variance, and I model it so that the difference in the meanvalue is a parameter to be estimated. Then you get in the output window the statistical test of whether the differences (difa,difb and difk) is zero. I recoded the sex-variable to be 0 or 1 instead of F or M.

zana
Calcite | Level 5

Thanks Jac, but this program have an error so i can't found any output.

ERROR: Quadrature accuracy of 0.000100 could not be achieved with 31 points.  The achieved accuracy was 1.000000.

NOTE: PROCEDURE NLMIXED used (Total process time):

      real time           9.79 seconds

      cpu time            9.79 seconds

In the other hand, i know about parameters (a,b & k). I expect nearly a=40, b=0.5 and k=0.01. So, i think they can't have the same variance.

Thanks for your kind.

Zana

JacobSimonsen
Barite | Level 11

You can try make a fixed-effect version of the model in order find good starting values for the meanvalues in the random-effect model. That may help you solve the convergence problem.

I got the suggested program to Work, but that was on a simulated dataset. I therefore knew some good startingvalues for the variance-parameters. But these values may not Work good for your data.

zana
Calcite | Level 5

Dear Jacob, thank you so much. Please see my attached data file, and let me i have your idea about that.

Tanks for your kind.

Zana

JacobSimonsen
Barite | Level 11

Sorry, I couldn't get it to converge either when I used your data. I suspect that the parameters are too Associated with each other. When I only had "a" as a mixed effect then I could get it to converge.

Your were right that the variances are not the same for the three parameters - that was also not what I meant, I was just very unprecise. I meant equal variance across gender.

SteveDenham
Jade | Level 19

One thing that often helps with non-convergence is a reparameterization or a rescaling of the variables. With the initial values of a and k differing by 4 orders of magnitude, and initial estimates of variance for the parameters being at least that far off, consider rescaling Age as Age/100, and increasing the initial value of k to 1.

Also, consider ridging.  Rather than the default quasi-Newton optimizer, consider using TECH=NRRIDG in the PROC NLMIXED statement.

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
  • 6 replies
  • 4149 views
  • 0 likes
  • 3 in conversation