12-08-2014 12:17 PM
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:
I used SAS9.1.3., could anyone please help me with that?
12-09-2014 09:13 AM
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;
random a b k ~ normal ([amu+sex*difa,bmu+sex*difb,kmu+sex*difk],[asigma,0,bsigma,0,0,ksigma]) subject=id;
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.
12-09-2014 06:09 PM
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.
12-10-2014 03:26 AM
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.
12-10-2014 12:48 PM
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.
12-11-2014 02:54 PM
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.