Hi!
I am working through an example given by SAS to create relative risk from this example: http://support.sas.com/kb/23/003.html
I'm working through it but I am now stuck. I run the preceding code:
data question;
input Gender $ Response $ Count;
datalines;
Women Yes 45
Women No 55
Men Yes 30
Men No 70
;
proc freq data=question order=data;
weight Count;
tables Gender*Response / relrisk;
run;
proc logistic data=question;
freq count;
class gender(ref="Men") / param=glm;
model response(event="Yes")=gender;
lsmeans gender / e ilink;
ods output coef=coeffs;
store out=ques;
run;
So far, so good. HOWEVER, when I submit the suggested %NLMeans macro:
%NLMeans(instore=ques, coef=coeffs, link=logit, options=ratio, title=Relative Risk);
I receive the following message:
"Warning: Apparent Invocation NLMeans not resolved"
Please advise! Thank you in advance!
Cheers,
David
Hi @davidmaron,
You need to download and submit the macro code from http://support.sas.com/kb/62/addl/fusion_62362_5_nlmeans.sas.txt in order to make it available to your SAS session.
Hello, where do I start downloading the code? I started with "Macro Argument List Start" and copied the following code. However, I cannot display the results after using NLmeans. Could you please give me the specific process of using NLmeans? Since I am an initial scholar, I do not know how to use macros for the time being. Thank you very much.
Hello @Lucai_sister,
%include 'your\path\nlest.sas'; %include 'your\path\nlmeans.sas';(of course, with "your\path" replaced by the location you chose for the two .sas files).
Hint: Generally, it is much better to open a new thread than to add questions to an old one (like from 2019), which only a few people will read.
Hello,
I followed the instructions to download the latest macros and saved both on my laptop. I then did the following:
%inc 'C:\Users\rup9\Desktop\HearHer\nlmeans.sas';
%inc 'C:\Users\rup9\Desktop\HearHer\nlest.sas';
When I try running both, I get the WARNING: Physical file does not exist, C:\Users\rup9\Desktop\HearHer\nlest.sas.
What am I doing wrong? Please help! Thank you.
Hello @pspen,
Most likely, you don't have SAS installed on your laptop, but you are using an interface such as SAS Studio or SAS Enterprise Guide which connects to a server-based SAS installation. That server cannot access your local C: drive, hence the error. If you can copy and paste the code from nlmeans.sas and nlest.sas into the program editor of your interface and then submit it from there, this should be the easiest solution. Otherwise you need to upload the two .sas files to the server, e.g., to a location where other .sas files reside that you've been working with, so that the server can access the code (e.g., again via %include, but with the new server path replacing the local "C:\Users\..." path).
Good luck!
Finally, let me repeat the hint from my previous post in this thread:
@FreelanceReinh wrote:
Hint: Generally, it is much better to open a new thread than to add questions to an old one (like from 2019), which only a few people will read.
So, if you don't succeed with the copy/paste or upload approaches suggested above, please open a new thread so that people using SAS Studio or SAS Enterprise Guide can further assist you.
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!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.