BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SR79
Fluorite | Level 6

Hi all, 

 

I am trying to fit nlmixed on the simulated data:

 

data simulated;
call streaminit(9);
do subject =1 to 10;
kd = rand('lognormal', -6, 1.2);
do t = 1 to 10;
response=exp(-kd*t);
output;
end;
end;
run;


data simulated2;
set simulated;
drop kd;
if response<0 then delete;
run;


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

 

 

I get the error:

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

 

I think it might have to do with the "pred**(2*delta)*s2" in the model statement. In the proc nlmixed approach, how is the variance typically estimated in the model statement?

 

In the simulated data for kd, I have it as lognormally distributed but the only option I see in the proc nlmixed random statement is to use normal. Has anyone done anything similar?

 

Any thoughts/help is much appreciated! 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

The default number of points used in the Gaussian quadrature method of integration in NLMIXED is 31.  An error like this generally means you don't have enough data to get started on the integration.  You have a couple of options. The first is to specify a smaller number of points using the QFAC= option.  In particular, if you set QFAC=1, then you are using a Laplace integration.  The second option is to steer away from Gaussian integration, using the METHOD= option.  I would suggest METHOD=FIRO, a first order method popularized by Beal and Sheiner for use in estimating population kinetics.

 

SteveDenham

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

I get the error:

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

 

I think it might have to do with the "pred**(2*delta)*s2" in the model statement. In the proc nlmixed approach, how is the variance typically estimated in the model statement?

 

In my opinion, this has more to do with the 31 data points than the model statement. But I don't have a lot of experience with NLMIXED.

 

@SR79 please, from now on, when you get an error in the log, show us the ENTIRE log for that PROC or for that DATA step. Do not show us errors disconnected from the code in the log.

--
Paige Miller
SR79
Fluorite | Level 6

Hi, 

 

That was the only error:

SR79_0-1662905201417.png

 

I am not clear why 31 is being mentioned regardless of any changes to the code. Thanks! 

 

PaigeMiller
Diamond | Level 26

Repeating:

 

show us the ENTIRE log for that PROC

 

Do not show us errors disconnected from the code in the log.

 

 

--
Paige Miller
ballardw
Super User

Log of an entire procedure means start with the PROC statement, include all of the code through the Run statement and all of the generated messages associated with the procedure.

 

It is much better to copy the LOG as text, open a text box on the forum and paste that log. That way we can copy and edit or use to make comments/explanations from log. Retyping pictures is no-ones favorite activity.

One reason we ask for the entire procedure is you might not believe the number of people who post "I submitted this code <code follows> and got this error" but after a dozen requests for the log when we finally get the log we find out the "code" posted was not what was submitted and generated the error(s). Sometimes the wrong data set is used for input, often one or more options/statements/variables is misspelled or missing, or extra variables are in the log not shown in the code.

 

 

SteveDenham
Jade | Level 19

The default number of points used in the Gaussian quadrature method of integration in NLMIXED is 31.  An error like this generally means you don't have enough data to get started on the integration.  You have a couple of options. The first is to specify a smaller number of points using the QFAC= option.  In particular, if you set QFAC=1, then you are using a Laplace integration.  The second option is to steer away from Gaussian integration, using the METHOD= option.  I would suggest METHOD=FIRO, a first order method popularized by Beal and Sheiner for use in estimating population kinetics.

 

SteveDenham

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 5 replies
  • 2231 views
  • 4 likes
  • 4 in conversation