BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SteveDenham
Jade | Level 19

Hi folks (and especially @StatDave ).  I am trying to execute %NLMeans using the following code:

 

proc glimmix data=anlset_block(where=(block in (2,3,4,5,6,7))) cholesky /*pconv=1e-6*/ method=laplace;
class block anml_nbr grp_no;
nloptions maxiter=10000;
model estrusCount/totalcount = grp_no|block/s ddfm=bw;
random intercept/subject=anml_nbr;
random block / subject=anml_nbr type=arh(1);
store out=proportions;
run;

proc plm restore=proportions;
lsmeans grp_no|block/e ilink diff;
ods output coef=coeffs;
run;

%include "B:\Steve\GLIMMIXforSAS\nlmeans.sas";;

%nlmeans(instore=proportions, coef=coeffs, link=logit, diff=1, null=0, title=Diff of Mean Proportions);

and get this in the log:

 

1154  %nlmeans(instore=proportions, coef=coeffs, link=logit, diff=1, null=0, title=Diff of Mean
1154! Proportions);
ERROR: The keyword parameter NULL was not defined with the macro.
ERROR: File WORK.EST.DATA does not exist.

I am sure I am missing something obvious, but I can't find the error msg in the macro code, so I suspect I did something wrong in my invocation.

 

I am running SASv9.4 (TS1M6) SAS/STAT 15.1.  The macro version is 1.3.

 

Thanks for looking.

 

SteveDenham

 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ
The versions of NLMeans and NLEST provided in SAS 9.4M6 are not the latest versions. The 1.3 and 1.8 versions became available later. They must be downloaded and their code run in each SAS session to use them. It does not matter where they are on your machine - simply use %inc statements to run them in your session.

View solution in original post

11 REPLIES 11
Ksharp
Super User

From the LOG. that implicate NULL= doesn't define in macro %nlmeans.

%nlmeans(instore=proportions, coef=coeffs, link=logit, diff=1, null=0, title=Diff of Mean Proportions);

then try to remove it .

%nlmeans(instore=proportions, coef=coeffs, link=logit, diff=1,  title=Diff of Mean Proportions);

SteveDenham
Jade | Level 19

Hi @Ksharp 

 

Same error when NULL=0 is removed...

 

SteveDenham

FreelanceReinh
Jade | Level 19

Hi @SteveDenham,

 

At least the first error message would occur if you were using a version of the NLEST macro (which is called by NLMEANS) that doesn't have the null= parameter yet. The documentation says that this parameter has been added in version 1.8 of NLEST, i.e., the latest version. Actually, in SAS 9.4M6 both NLMEANS and NLEST should be available via autocall (i.e., without an explicit %INCLUDE as you are using) according to the red notes in both documentations. So I'm not sure why an older version of NLEST might be involved in your SAS session, but the version of NLEST is the first thing I would check.

SteveDenham
Jade | Level 19

Not so easy to do, as the \sasmacro folder is locked, and only the admin can add in the newer versions.  Thus the %include to another location.  That might mean the %NLEst macro is unavailable to NLMeans.

 

I'll try some moving/copying to see if that helps.

 

SteveDenham

StatDave
SAS Super FREQ
The versions of NLMeans and NLEST provided in SAS 9.4M6 are not the latest versions. The 1.3 and 1.8 versions became available later. They must be downloaded and their code run in each SAS session to use them. It does not matter where they are on your machine - simply use %inc statements to run them in your session.
SteveDenham
Jade | Level 19

Thanks @StatDave.  Works like a charm now.  On to MULTTEST to adjust for multiple comparisons (PS.  An idea for future versions would be to add some choices for multiple comparison adjustments)

 

SteveDenham

StatDave
SAS Super FREQ
See the Details section of the NLMeans macro documentation which describes the data set containing the results. You should easily be able to use that in MULTTEST to adjust the p-values for multiple testing.
FreelanceReinh
Jade | Level 19

@StatDave wrote:
The versions of NLMeans and NLEST provided in SAS 9.4M6 are not the latest versions. The 1.3 and 1.8 versions became available later. They must be downloaded and their code run in each SAS session to use them.

Thanks, @StatDave, for pointing this out. So, the red notes (like "breaking news") in the documentation pages Sample 58775 and Sample 62362 saying "Beginning in SAS® 9.4M6 (TS1M6), this macro is available ..." should better be more specific about the macro versions they are referring to.

StatDave
SAS Super FREQ
Yes, I have already updated those Notes and the History tables to help clarify this.
StatDave
SAS Super FREQ

You are apparently either not using version 1.3 of NLMeans, or are not also running version 1.8 of the NLEST macro which it requires as noted in the documentation of the NLMeans macro. In that documentation, see the History section and the description of NULL= which detail the requirements. To verify the versions of both macros that you are running, specify any text immediately following the open parenthesis as shown in the History section. Do not alter the macro code of either macro in any way.

SteveDenham
Jade | Level 19

that seems logical-let's see what happens, and there it is, the version of %NLestimate is 1.6.

 

Download time.  If that solves the problem, I'll be back to mark this as answered.

 

SteveDenham

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 11 replies
  • 2928 views
  • 5 likes
  • 4 in conversation