12-17-2015 07:26 PM
I am trying to use SAS (SAS University Edition) to fit a nonlinear mixed-effects model to my data. Before fitting the model, I first import the data into SAS. This data consists in repeated measurements (over time) for a group of individuals (the dataset is attached). To distinguish between individuals, I use a grouping variable grp. This dataset is not a 'synthetic dataset' (ie. the data was not generated using the model itself or another model).
Here is the code to import the data :
filename mydata '/folders/myfolders/data_for_nlmixed_procedure.txt';
infile mydata delimiter=',';
input X Y grp;
Once the data is imported into SAS, here is the code I use (and the model I want to fit to my data) :
proc nlmixed data=datagen tech=quanew linesearch=6 method=gauss qpoints=1 maxfunc=100000 maxiter=6000;
parms p0=1.33301 t0=71.7015 v0=-0.0002 s2gamma=0.48836 s2tau=40.5372 s2e=0.02251;
model Y ~ normal( p0 + exp(gamma)*v0*(X-t0-tau) , s2e);
random gamma tau ~ normal([0, 0], [s2gamma, 0, s2tau]) subject=grp out=eb_rh_insula;
When using this code, I often encounter the following error : "No valid parameter points were found". For example, this happens by choosing as initial values : p0=3.33 t0=51 v0=-0.002 s2gamma=0.48 s2tau=40 s2e=0.02. To deal with this error message, I assumed I had to try different starting values. Once I found correct starting values, the procedure NLMIXED often has difficulties to converge. For example, running the code above gives me :
12-18-2015 01:19 AM
I'm no expert with nlmixed but one thing that sure helps is to remove subjects without enough points. I think the difficulty might be with the product of gamma and tau, both being random. Anyway, this takes a while but converges...
proc sql; create table b as select * from datagen group by grp having count(*) >= 3; quit; proc nlmixed data=b tech=quanew qpoints=8; parms p0=2.5 t0=71.7015 v0=-8.5 s2gamma=6 s2tau=40.5372 s2e=0.02251; model Y ~ normal( p0 - exp(gamma)*(X-tau) , s2e); random gamma tau ~ normal([v0, t0], [s2gamma, 0, s2tau]) subject=grp; run;
12-18-2015 06:53 AM
Thank you for your answer ! I will try this new code.
I am interested in having several points of view on the model or the NLMIXED procedure. This would probably help me understand where are the difficulties coming from when fitting the model to some data.