Help using Base SAS procedures

ROC power

Reply
Occasional Contributor
Posts: 15

ROC power

I am unable to use the macro %ROCPOWER, which I need to compute the power of a diagnostic tool.
I downloaded it from http://www.bio.ri.ccf.org/doc/rocpower.sas.
All I do is changing the first line as requested in the help file (http://www.bio.ri.ccf.org/doc/rocpower_help.txt) and then running the program. I just get the log of the procedure but no output.
Using SAS v9.1.

Any thoughts? Message was edited by: Iron_grief
PROC Star
Posts: 7,360

Re: ROC power

I'm not sure what you mean by "change the first line". It is a macro thus, if it is written correctly, you shouldn't have to change any of its lines.

After running it, you actually get it to work by calling the macro as described in the text file.

I don't have the time or expertise to review the macro code, but I did run it. To get it to run, I had to add a line to the macro, namely a run; statement just before the %mend.

Similarly, the text file appears to have some errors in it (e.g., it indicate calling the macro with a TO variable rather than the T0 variable that is used in the macro).

I got it to work with the following call:
[pre]
%ROCPOWER(T1=.90, T2=.70, T0=.70, R=.41, N=100, PERCENT=.50, ORDINAL=1)
[/pre]

HTH,
Art

> I am unable to use the macro %ROCPOWER, which I need
> to compute the power of a diagnostic tool.
> I downloaded it from
> http://www.bio.ri.ccf.org/doc/rocpower.sas.
> All I do is changing the first line as requested in
> the help file
> (http://www.bio.ri.ccf.org/doc/rocpower_help.txt) and
> then running the program. I just get the log of the
> procedure but no output.
> Using SAS v9.1.
>
> Any thoughts?
>
> Message was edited by: Iron_grief
Occasional Contributor
Posts: 15

Re: ROC power

I didn't demand anyone to review and debug the macro code, just to try it and see if it works, for which I give you thanks.
What do you mean by calling? I admit I am not an expert with macros, but do I have to create a new program and write the call inside of it, or do I have to add that line at the beginning of the macro itself? I tried both the ways and the program just appears in the log but no output.
Must the "run;" statement be added before the first %mend (line 22) or the last?

Again, thanks for your help.
PROC Star
Posts: 7,360

Re: ROC power

The run statement should only be added at the bottom of the file, just before the last %mend; line.

Plus, I removed the semicolon at the end of the line that calls the macro, as it should not have been there.

Thus, the only things I changed were two of the last three lines in the programs, namely:
[pre]
run;
%mend;
%ROCPOWER(T1=.90, T2=.70, T0=.70, R=.41, N=100, PERCENT=.50, ORDINAL=1)
[/pre]

I know that you weren't demanding anything. I was just pointing out that I didn't take the time to discover if the macro really did what it was intended to do .. only to make some changes so that it would compile and run.

Once compiled (which is done by running the code), the macro can be called as many times as necessary by simply running the last line (i.e., the line:
[pre]
%ROCPOWER(T1=.90, T2=.70, T0=.70, R=.41, N=100, PERCENT=.50, ORDINAL=1)
[/pre]

of course, changing the values that you want to pass to the macro.

Art
Occasional Contributor
Posts: 15

Re: ROC power

It works now.
Thank you so much for your patience.
What puzzles me is why don't they release already complete macros?

Best,

P.S. Is there a way to spread reputation in this forum? You definitely deserve some! Message was edited by: Iron_grief
PROC Star
Posts: 7,360

Re: ROC power

Thanks for your kind words, but I'm past the point in my career of needing any more recognition. There are numerous macros on the web. Some are perfect, some don't quite work as intended, and others would probably have been better off left in some programmer or statistician's mind.

The one you asked about was apparently posted by someone who used to work at the Cleveland Clinic, but apparently not one that anyone is maintaining.

Fortunately, boards and websites like this one, SAS-L and sasCommunity.org are populated by enough folks with sufficiently sharp programming and/or analytic skills (and willingness to help others for free) that one always has a place to question code that they find.

Glad to be of assistance,
Art
----------
> It works now.
> Thank you so much for your patience.
> What puzzles me is why don't they release already
> complete macros?
>
> Best,
>
> P.S. Is there a way to spread reputation in this
> forum? You definitely deserve some!
>
> Message was edited by: Iron_grief
Ask a Question
Discussion stats
  • 5 replies
  • 879 views
  • 0 likes
  • 2 in conversation