BookmarkSubscribeRSS Feed
SR79
Fluorite | Level 6

Hi, 

 

I am trying to use proc nlmixed on a set of simulated data to check for different models and their AIC/BIC criteria. This attempt below is to model the first one which is: response = y0*exp(-kd*t). 

 

Below, I have the simulated data, dropped the parameter kd and then try to fit the nlmixed:


data simulated;
call streaminit(9);
do subject =1 to 100;
y0=rand('normal',1,5);
k1=rand('normal', 2,2);
k2=rand('normal',7,2);
kd=rand('normal',2,3);
do t = 1 to 10;
response=y0*exp(-kd*t);
output;
end;
end;
run;

 


data simulated2;
set simulated;
drop kd;
run;

 

proc nlmixed data=simulated2 method=gauss;
parms kd=1 delta=0.5 s2=2;
pred=y0*exp(-kd*t);
model response~normal(pred, pred**(2*delta)*s2);
random kd ~ normal(1,2)
subject=subject;
run;

 

I am getting the following error:

NOTE: Execution error for observation 11.

 

There's nothing specific about observation 11 which is the first record for subject 2: 

SR79_1-1662822540489.png

 

Any thoughts/help on this would be much appreciated!!

Thank you!

6 REPLIES 6
PaigeMiller
Diamond | Level 26

Work through the math. Observation 11 produces an invalid value in the second argument here:

 

model response~normal(pred, pred**(2*delta)*s2);
--
Paige Miller
SR79
Fluorite | Level 6

Thanks for responding. I updated the code to make sure it's a positive value for variance but now I have the following coming up:

 

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

 

Does this mean that the problem doesn't converge?

 

Thank you. 

 

 

PaigeMiller
Diamond | Level 26

I have not had that happen to me, but "does not converge" is what I think it means.

--
Paige Miller
SR79
Fluorite | Level 6

There was a problem with the input statement, I think I have figured it out. 🙂 Thanks!!

PaigeMiller
Diamond | Level 26

Please explain what the solution was that you found.

--
Paige Miller
SteveDenham
Jade | Level 19

I am in the same boat as @PaigeMiller .  You say the problem was with the input statement.  I don't see such a thing in the code you posted, and as far as I know, PROC NLMIXED doesn't support an "input statement".  So, how did you solve this issue?

 

SteveDenham

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 688 views
  • 1 like
  • 3 in conversation