<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAS runs slower with each macro call simulated power in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984883#M379749</link>
    <description>&lt;P&gt;I want to cry.&amp;nbsp; I wrote a long reply to this and now I don't see it.&amp;nbsp; Okay, let me try again.&amp;nbsp; Maybe it timed out.&amp;nbsp; Okay, this time let me just copy the code and then describe what I'm doing in a separate post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO OBS (p,&amp;nbsp; &amp;nbsp; sens,&amp;nbsp; &amp;nbsp; spec,&amp;nbsp; n);&lt;BR /&gt;data x;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;seed = 23867;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;do sim = 1 to 10000;&amp;nbsp; &amp;nbsp; * THIS IS THE NUMBER OF SIMULATIONS ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; do i = 1 to &amp;amp;N;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* THIS IS OUR POSITED SAMPLE SIZE ;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;z = ranuni (seed);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if 0 &amp;lt;= z &amp;lt; &amp;amp;P then do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Gold_Standard = '0_POS';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;zz = ranuni (seed);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if 0 &amp;lt;= zz &amp;lt; &amp;amp;SENS then Our_Test = '0_POS';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if &amp;amp;SENS &amp;lt;= zz &amp;lt;= 1 then Our_Test = '1_NEG';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if &amp;amp;P &amp;lt;= z &amp;lt;= 1 then do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Gold_Standard = '1_NEG';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;zz = ranuni (seed);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if 0 &amp;lt;= zz &amp;lt; &amp;amp;SPEC then Our_Test = '1_NEG';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if &amp;amp;SPEC &amp;lt;= zz &amp;lt;= 1 then Our_Test = '0_POS';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; output;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data Sensitivity;&amp;nbsp; &amp;nbsp; set x;&amp;nbsp; &amp;nbsp; where Gold_Standard = '0_POS';&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=Sensitivity; by sim; run;&lt;BR /&gt;ods select none;&lt;BR /&gt;ods output BinomialTest = Sensitivity2;&lt;BR /&gt;proc freq data=Sensitivity;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;by sim;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;tables Our_Test / binomial (p=0.775);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;exact binomial;&lt;BR /&gt;run;&lt;BR /&gt;ods select all;&lt;BR /&gt;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;* --EACH SIMULATION WILL HAVE EITHER XPR_BIN OR XPL_BIN. WE KEEP THOSE HERE. ;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;data Sensitivity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Sensitivity2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 in ('XPR_BIN','XPL_BIN');&lt;BR /&gt;&amp;nbsp; &amp;nbsp;p_sens = nValue1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;* --WE ADD 0.50 TO THE LEFT-SIDED P-VALUES WHERE. THE IDEA IS THAT ALL OUR P-VALUES&lt;BR /&gt;* WILL CORRESPOND TO A RIGHT-SIDED TEST. IOW, WE ARE TESTING Ha: Sensitivity &amp;gt; 0.775.&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;data Sensitivity4;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Sensitivity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 = 'XPL_BIN' then p_sens = min (1, p_sens + 0.50);&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*****************************************************************;&lt;BR /&gt;****************** SENSITIVITY ENDS ABOVE *******************;&lt;BR /&gt;****************** SPECIFICITY STARTS BELOW *******************;&lt;BR /&gt;*****************************************************************;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data Specificity;&amp;nbsp; &amp;nbsp; set x;&amp;nbsp; &amp;nbsp; where Gold_Standard = '1_NEG';&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=Specificity; by sim; run;&lt;BR /&gt;ods select none;&lt;BR /&gt;ods output BinomialTest = Specificity2;&lt;BR /&gt;proc freq data=Specificity;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;by sim;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;tables Our_Test / binomial (p=0.225);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;exact binomial;&lt;BR /&gt;run;&lt;BR /&gt;ods select all;&lt;BR /&gt;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;* --EACH SIMULATION WILL HAVE EITHER XPR_BIN OR XPL_BIN. WE KEEP THOSE HERE. ;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;data Specificity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Specificity2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 in ('XPR_BIN','XPL_BIN');&lt;BR /&gt;&amp;nbsp; &amp;nbsp;p_spec = nValue1;&lt;BR /&gt;run; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;* --WE ADD 0.50 TO THE LEFT-SIDED P-VALUES WHERE. THE IDEA IS THAT ALL OUR P-VALUES&lt;BR /&gt;* WILL CORRESPOND TO A RIGHT-SIDED TEST. IOW, WE ARE TESTING Ha: Sensitivity &amp;gt; 0.775.&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;data Specificity4;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Specificity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 = 'XPR_BIN' then p_spec = min (1, p_spec + 0.50);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;******************&amp;nbsp; COMBINE FOR RESULTS FOR SENSITIVITY AND SPECIFICITY HERE&amp;nbsp; ********;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=Sensitivity4;&amp;nbsp; &amp;nbsp; by sim;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;proc sort data=Specificity4;&amp;nbsp; &amp;nbsp; by sim;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;data Sens_Spec;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; merge Sensitivity4&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Specificity4;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; by sim;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if p_sens &amp;lt; 0.05 then Sens_Good = 1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if p_sens &amp;gt;= 0.05 then Sens_Good = 0;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if p_spec &amp;lt; 0.05 then Spec_Good = 1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if p_spec &amp;gt;= 0.05 then Spec_Good = 0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data=Sens_Spec;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; tables Sens_Good * Spec_Good / out=test norow nocol;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=test;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;%MEND OBS;&lt;BR /&gt;&lt;BR /&gt;%OBS (0.55,&amp;nbsp; &amp;nbsp; 0.85,&amp;nbsp; &amp;nbsp; 0.85,&amp;nbsp; &amp;nbsp; 470);&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Mar 2026 16:20:36 GMT</pubDate>
    <dc:creator>n6b</dc:creator>
    <dc:date>2026-03-17T16:20:36Z</dc:date>
    <item>
      <title>SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984869#M379746</link>
      <description>&lt;P&gt;I'm running simulations for power &amp;amp; sample size.&amp;nbsp; I generate the random data, separate it into two datasets (call them x and y), then I use dataset x in a proc freq and output to a new dataset x2, then I use dataset y in a proc freq and output to a new dataset y2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Doing that is one set of 10,000 simulations and it gives me one power estimate.&amp;nbsp; But this is one of those cases where you give it an N, it gives you the power, then you have to adjust the N and run again and it gives you power again, etc.&amp;nbsp; And you keep doing it until you hone in on the n that gives you 80% power.&amp;nbsp; And I have to do this general thing for many different cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I open up SAS and submit my first macro call to estimate power and it runs pretty quickly.&amp;nbsp; Then I submit another and it runs more slowly.&amp;nbsp; Then another and it runs more slowly yet.&amp;nbsp; Etc.&amp;nbsp; And in looking at the log it is the proc freq that it is taking the time.&amp;nbsp; I do some other things but they're all fast.&amp;nbsp; The first time through the proc freq takes about a minute.&amp;nbsp; The next time maybe 2.5.&amp;nbsp; The next time maybe 4.5.&amp;nbsp; Etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, this is not feasible when you have a lot of results to generate.&amp;nbsp; One way around it is to open SAS, run it once, get the result, shut down SAS and re-open it, then run the next one, etc.&amp;nbsp; But of course, that's a pain.&amp;nbsp; Is there some way to wipe the memory, or do whatever needs to be done, without closing SAS every time?&amp;nbsp; I have tried proc datases delete=work._all_; but that didn't make any difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The proc freq in question does have an "exact binomial" option in it but I tried running it with that commented out and the same phenomenon of it getting slower and slower each time still occurred.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated from the All Knowledgeable Board.&amp;nbsp; Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 14:33:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984869#M379746</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T14:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984877#M379747</link>
      <description>&lt;P&gt;Are you sure that what you are attempting to get power is not available in Proc Power? Or maybe Proc GLMPower? These procedures have options that let you set multiple things like multiple power and generate needed size N or vice versa.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you sending Proc Freq output to the default display? As that gets more output then just doing the display refresh may be part of the issue. I would suggest turning off the display using the Proc Freq NOPRINT option and generate data sets from Proc Freq with the desired output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may help to post the code of the macro so we don't have to ask a bunch of "do you have this option enabled/disabled" questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 15:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984877#M379747</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2026-03-17T15:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984880#M379748</link>
      <description>&lt;P&gt;I'm trying to get power for Sensitivity and Specificity.&amp;nbsp; But I don't want to compute it one time for Sensitivity and once again for Specificity.&amp;nbsp; Rather I'm trying to get the power to say simultaneously, (a) Sensitivity &amp;gt; p1 and (b) Specificity &amp;gt; p2.&amp;nbsp; I can't just (a) find power for Sensitivity by itself and (b) find power for Specificity by itself and (c) just multiply the two together because they are not independent.&amp;nbsp; That said, I just now multiplied the power for Sensitivity in my simulations by the power for Specificity in my simulations and so far it is always close to but slightly larger than my simulated power for both Sensitivity and Specificity simultaneously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there was a way for proc power to give me the n for 80% power for a specified sensitivity and specificity at the same time I would be ecstatic but I don't think that's the case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had already turned off the proc freq display and it still was slow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is below.&amp;nbsp; The Gold Standard outcome is Positive 55% of the time and Negative 45%, so the value of the macro argument p is 0.55 and the macro call at the end.&amp;nbsp; From the macro call at the end you can also see that sensitivity and specificity are both 85% and the N for this macro call is 470.&amp;nbsp; Of course all that is just for one macro call.&amp;nbsp; My ultimate goal is to find the power for various combinations of specifiied Sensitivity and Specificity, with the alternative hypothesis always being that both is greater than 77.5%.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I said, if there's a slick way for proc power to do this all at once then I'm all for it but as far as I can tell the only way to do this is via simulations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO OBS (p,&amp;nbsp; &amp;nbsp; sens,&amp;nbsp; &amp;nbsp; spec,&amp;nbsp; &amp;nbsp; n);&lt;BR /&gt;data x;&lt;BR /&gt;seed = 23867;&lt;BR /&gt;&lt;BR /&gt;do sim = 1 to 10000;&amp;nbsp; * THIS IS THE NUMBER OF SIMULATIONS ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; do i = 1 to &amp;amp;N;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * THIS IS OUR POSITED SAMPLE SIZE ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;z = ranuni (seed);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if 0 &amp;lt;= z &amp;lt; &amp;amp;P then do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Gold_Standard = '0_POS';&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;zz = ranuni (seed);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if 0 &amp;lt;= zz &amp;lt; &amp;amp;SENS then Our_Test = '0_POS';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if &amp;amp;SENS &amp;lt;= zz &amp;lt;= 1 then Our_Test = '1_NEG';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if &amp;amp;P &amp;lt;= z &amp;lt;= 1 then do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Gold_Standard = '1_NEG';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;zz = ranuni (seed);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if 0 &amp;lt;= zz &amp;lt; &amp;amp;SPEC then Our_Test = '1_NEG';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if &amp;amp;SPEC &amp;lt;= zz &amp;lt;= 1 then Our_Test = '0_POS';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data Sensitivity;&amp;nbsp; &amp;nbsp; set x;&amp;nbsp; &amp;nbsp; where Gold_Standard = '0_POS';&amp;nbsp; &amp;nbsp;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=Sensitivity;&amp;nbsp; &amp;nbsp; by sim;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;ods select none;&lt;BR /&gt;ods output BinomialTest = Sensitivity2;&lt;BR /&gt;proc freq data=Sensitivity;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;by sim;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;tables Our_Test / binomial (p=0.775);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;exact binomial;&lt;BR /&gt;run;&lt;BR /&gt;ods select all;&lt;BR /&gt;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;* --EACH SIMULATION WILL HAVE EITHER XPR_BIN OR XPL_BIN. WE KEEP THOSE HERE. ;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;data Sensitivity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Sensitivity2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 in ('XPR_BIN','XPL_BIN');&lt;BR /&gt;&amp;nbsp; &amp;nbsp;p_sens = nValue1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;* --WE ADD 0.50 TO THE LEFT-SIDED P-VALUES WHERE. THE IDEA IS THAT ALL OUR P-VALUES&lt;BR /&gt;* WILL CORRESPOND TO A RIGHT-SIDED TEST. IOW, WE ARE TESTING Ha: Sensitivity &amp;gt; 0.775.&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;data Sensitivity4;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Sensitivity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 = 'XPL_BIN' then p_sens = min (1, p_sens + 0.50);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;*****************************************************************;&lt;BR /&gt;****************** SENSITIVITY ENDS ABOVE *******************;&lt;BR /&gt;****************** SPECIFICITY STARTS BELOW *******************;&lt;BR /&gt;*****************************************************************;&lt;BR /&gt;&lt;BR /&gt;data Specificity;&amp;nbsp; &amp;nbsp; set x;&amp;nbsp; &amp;nbsp; where Gold_Standard = '1_NEG';&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=Specificity;&amp;nbsp; &amp;nbsp; by sim;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;ods select none;&lt;BR /&gt;ods output BinomialTest = Specificity2;&lt;BR /&gt;proc freq data=Specificity;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;by sim;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;tables Our_Test / binomial (p=0.225);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;exact binomial;&lt;BR /&gt;run;&lt;BR /&gt;ods select all;&lt;BR /&gt;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;* --EACH SIMULATION WILL HAVE EITHER XPR_BIN OR XPL_BIN. WE KEEP THOSE HERE. ;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;data Specificity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Specificity2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 in ('XPR_BIN','XPL_BIN');&lt;BR /&gt;&amp;nbsp; &amp;nbsp;p_spec = nValue1;&lt;BR /&gt;run;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;* --WE ADD 0.50 TO THE LEFT-SIDED P-VALUES WHERE. THE IDEA IS THAT ALL OUR P-VALUES&lt;BR /&gt;* WILL CORRESPOND TO A RIGHT-SIDED TEST. IOW, WE ARE TESTING Ha: Sensitivity &amp;gt; 0.775.&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;data Specificity4;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Specificity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 = 'XPR_BIN' then p_spec = min (1, p_spec + 0.50);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;****** WE COMBINE THE RESULTS FOR SENSITIVITY AND SPECIFICITY HERE.&amp;nbsp; &amp;nbsp;******;&lt;BR /&gt;&lt;BR /&gt;proc sort data=Sensitivity4;&amp;nbsp; &amp;nbsp; by sim;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;proc sort data=Specificity4;&amp;nbsp; &amp;nbsp; by sim;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;data Sens_Spec;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;merge Sensitivity4&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Specificity4;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; by sim;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if p_sens &amp;lt; 0.05 then Sens_Good = 1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if p_sens &amp;gt;= 0.05 then Sens_Good = 0;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if p_spec &amp;lt; 0.05 then Spec_Good = 1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if p_spec &amp;gt;= 0.05 then Spec_Good = 0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data=Sens_Spec;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;tables Sens_Good * Spec_Good / out=test norow nocol;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=test; run;&lt;BR /&gt;&lt;BR /&gt;%MEND OBS;&lt;BR /&gt;&lt;BR /&gt;%OBS (0.55,&amp;nbsp; &amp;nbsp;0.85,&amp;nbsp; &amp;nbsp;0.85,&amp;nbsp; &amp;nbsp;470);&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 16:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984880#M379748</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T16:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984883#M379749</link>
      <description>&lt;P&gt;I want to cry.&amp;nbsp; I wrote a long reply to this and now I don't see it.&amp;nbsp; Okay, let me try again.&amp;nbsp; Maybe it timed out.&amp;nbsp; Okay, this time let me just copy the code and then describe what I'm doing in a separate post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO OBS (p,&amp;nbsp; &amp;nbsp; sens,&amp;nbsp; &amp;nbsp; spec,&amp;nbsp; n);&lt;BR /&gt;data x;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;seed = 23867;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;do sim = 1 to 10000;&amp;nbsp; &amp;nbsp; * THIS IS THE NUMBER OF SIMULATIONS ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; do i = 1 to &amp;amp;N;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* THIS IS OUR POSITED SAMPLE SIZE ;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;z = ranuni (seed);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if 0 &amp;lt;= z &amp;lt; &amp;amp;P then do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Gold_Standard = '0_POS';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;zz = ranuni (seed);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if 0 &amp;lt;= zz &amp;lt; &amp;amp;SENS then Our_Test = '0_POS';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if &amp;amp;SENS &amp;lt;= zz &amp;lt;= 1 then Our_Test = '1_NEG';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if &amp;amp;P &amp;lt;= z &amp;lt;= 1 then do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Gold_Standard = '1_NEG';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;zz = ranuni (seed);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if 0 &amp;lt;= zz &amp;lt; &amp;amp;SPEC then Our_Test = '1_NEG';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if &amp;amp;SPEC &amp;lt;= zz &amp;lt;= 1 then Our_Test = '0_POS';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; output;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data Sensitivity;&amp;nbsp; &amp;nbsp; set x;&amp;nbsp; &amp;nbsp; where Gold_Standard = '0_POS';&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=Sensitivity; by sim; run;&lt;BR /&gt;ods select none;&lt;BR /&gt;ods output BinomialTest = Sensitivity2;&lt;BR /&gt;proc freq data=Sensitivity;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;by sim;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;tables Our_Test / binomial (p=0.775);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;exact binomial;&lt;BR /&gt;run;&lt;BR /&gt;ods select all;&lt;BR /&gt;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;* --EACH SIMULATION WILL HAVE EITHER XPR_BIN OR XPL_BIN. WE KEEP THOSE HERE. ;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;data Sensitivity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Sensitivity2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 in ('XPR_BIN','XPL_BIN');&lt;BR /&gt;&amp;nbsp; &amp;nbsp;p_sens = nValue1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;* --WE ADD 0.50 TO THE LEFT-SIDED P-VALUES WHERE. THE IDEA IS THAT ALL OUR P-VALUES&lt;BR /&gt;* WILL CORRESPOND TO A RIGHT-SIDED TEST. IOW, WE ARE TESTING Ha: Sensitivity &amp;gt; 0.775.&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;data Sensitivity4;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Sensitivity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 = 'XPL_BIN' then p_sens = min (1, p_sens + 0.50);&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*****************************************************************;&lt;BR /&gt;****************** SENSITIVITY ENDS ABOVE *******************;&lt;BR /&gt;****************** SPECIFICITY STARTS BELOW *******************;&lt;BR /&gt;*****************************************************************;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data Specificity;&amp;nbsp; &amp;nbsp; set x;&amp;nbsp; &amp;nbsp; where Gold_Standard = '1_NEG';&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=Specificity; by sim; run;&lt;BR /&gt;ods select none;&lt;BR /&gt;ods output BinomialTest = Specificity2;&lt;BR /&gt;proc freq data=Specificity;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;by sim;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;tables Our_Test / binomial (p=0.225);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;exact binomial;&lt;BR /&gt;run;&lt;BR /&gt;ods select all;&lt;BR /&gt;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;* --EACH SIMULATION WILL HAVE EITHER XPR_BIN OR XPL_BIN. WE KEEP THOSE HERE. ;&lt;BR /&gt;********************************************************************************;&lt;BR /&gt;data Specificity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Specificity2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 in ('XPR_BIN','XPL_BIN');&lt;BR /&gt;&amp;nbsp; &amp;nbsp;p_spec = nValue1;&lt;BR /&gt;run; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;* --WE ADD 0.50 TO THE LEFT-SIDED P-VALUES WHERE. THE IDEA IS THAT ALL OUR P-VALUES&lt;BR /&gt;* WILL CORRESPOND TO A RIGHT-SIDED TEST. IOW, WE ARE TESTING Ha: Sensitivity &amp;gt; 0.775.&lt;BR /&gt;*******************************************************************************************&lt;BR /&gt;data Specificity4;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set Specificity3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if Name1 = 'XPR_BIN' then p_spec = min (1, p_spec + 0.50);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;******************&amp;nbsp; COMBINE FOR RESULTS FOR SENSITIVITY AND SPECIFICITY HERE&amp;nbsp; ********;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=Sensitivity4;&amp;nbsp; &amp;nbsp; by sim;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;proc sort data=Specificity4;&amp;nbsp; &amp;nbsp; by sim;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;data Sens_Spec;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; merge Sensitivity4&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Specificity4;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; by sim;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if p_sens &amp;lt; 0.05 then Sens_Good = 1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if p_sens &amp;gt;= 0.05 then Sens_Good = 0;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if p_spec &amp;lt; 0.05 then Spec_Good = 1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if p_spec &amp;gt;= 0.05 then Spec_Good = 0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data=Sens_Spec;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; tables Sens_Good * Spec_Good / out=test norow nocol;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=test;&amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;%MEND OBS;&lt;BR /&gt;&lt;BR /&gt;%OBS (0.55,&amp;nbsp; &amp;nbsp; 0.85,&amp;nbsp; &amp;nbsp; 0.85,&amp;nbsp; &amp;nbsp; 470);&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 16:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984883#M379749</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T16:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984884#M379750</link>
      <description>&lt;P&gt;Good, it posted, now let me explain.&amp;nbsp; I want to find power for Sensitivity and Specificity simultaneously.&amp;nbsp; I could just find the power for each separately and then multiply them together, which would be easy with proc power, except they are not independent.&amp;nbsp; I want to find the power for BOTH to be above 77.5% (the p in our Ha).&amp;nbsp; That said, in the simulations I've done so far I've multiplied the power for the two and in every case it was close to (and a little more than) the power for both simultaneously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If proc power has a way to compute power for a specified Sensitivity and Specificity at the same time I'd be ecstatic but I don't think that's the case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had already suppressed output for proc freq and it was still slow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what we have in a nutshell.&amp;nbsp; We have a Gold Standard that we think will be Positive 55% of the time and Negative the other 45%.&amp;nbsp; That is the first macro argument (0.55).&amp;nbsp; The next two macro arguments are the Sensitivity and Specificity that we are specifying.&amp;nbsp; In the macro call both are 0.85, although my larger goal is to find power for many combinations of these two.&amp;nbsp; And the last macro argument is the 470, which is the sample size.&amp;nbsp; We want to get 77.5% power.&amp;nbsp; So as of now, I run the macro, see the result, adjust the N appropriately and run it again, etc.&amp;nbsp; As you can imagine this will take awhile when it takes longer and longer with every macro call, thus my question.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 16:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984884#M379750</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T16:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984890#M379751</link>
      <description>&lt;P&gt;You have some comment statements with missing semicolons causing error.&amp;nbsp; &amp;nbsp; After fixing that I get the result below.&amp;nbsp; Which parameter(s) do you change for the second run of the macro based on the result here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%OBS (0.55, 0.85, 0.85, 470);  &lt;/PRE&gt;
&lt;PRE&gt;       Sens_    Spec_                     
 Obs     Good     Good    COUNT    PERCENT 
                                           
  1       0        0        126      1.26  
  2       0        1        669      6.69  
  3       1        0       1297     12.97  
  4       1        1       7908     79.08  
&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Mar 2026 17:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984890#M379751</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2026-03-17T17:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984891#M379752</link>
      <description>&lt;P&gt;I copied and pasted the code and tried to neaten it up for readability so that explains those issues.&amp;nbsp; Sorry for the inconvenience.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But anyway, yes, I got exactly what you got.&amp;nbsp; For me at least, if I look at the log, the 2nd proc freq (for specificity) takes considerably longer than the 1st proc freq.&amp;nbsp; Then if I submit the macro again, the proc freq for sensitivity is longer yet.&amp;nbsp; Then the proc freq for specificity even longer yet.&amp;nbsp; And so all for each macro call.&amp;nbsp; Each one way proc freq that computes the Binomial test takes longer than the previous.&amp;nbsp; (The&amp;nbsp;two-way proc freq at the very end of the macro that gives the final results always runs quickly.)&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 17:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984891#M379752</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T17:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984892#M379753</link>
      <description>&lt;P&gt;Oops, I didn't read the last sentence of your message.&amp;nbsp; I want to get 77.5% power.&amp;nbsp; The last line in that proc print indicates that for n=470 and with 85% Sensitivity and Specificity, we get 79.08% power.&amp;nbsp; So what I'd do is reduce the N and run it again to try to get closer to 77.5%.&amp;nbsp; And continue that process until I get to 77.5% power.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then when I achieve that, I'll start the whole process anew but this time I'll assume 85% Sensitivity and 86% Specificity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I'll do that for all combinations of Sensitivity and Specificity for 85 to 90%, which means a total of 6 x 6 = 36 N numbers to achieve 77.5% power for the specific combination of Sensitivity and Specificity.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 17:30:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984892#M379753</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T17:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984895#M379754</link>
      <description>&lt;P&gt;I think you need to show some of the actual LOG output with OPTIONS FULLSTIMER;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;MPRINT(OBS):   ods select none;
MPRINT(OBS):   ods output BinomialTest = Sensitivity2;
MPRINT(OBS):   proc freq data=Sensitivity;
MPRINT(OBS):   by sim;
MPRINT(OBS):   tables Our_Test / binomial (p=0.775);
MPRINT(OBS):   exact binomial;
MPRINT(OBS):   run;

NOTE: The data set WORK.SENSITIVITY2 has 80000 observations and 6 variables.
NOTE: There were 5333602 observations read from the data set WORK.SENSITIVITY.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           1.65 seconds
      user cpu time       1.50 seconds
      system cpu time     0.15 seconds
      memory              1024.21k
      OS Memory           13148.00k
      Timestamp           03/17/2026 10:06:59 AM
      Step Count                        20  Switch Count  0

MPRINT(OBS):   ods select all;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Mar 2026 17:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984895#M379754</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2026-03-17T17:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984896#M379755</link>
      <description>&lt;P&gt;Wait a minute, I'm sorry if I've been confusing so let me state it clearly and correctly here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We want to show that was have Sensitivity &amp;gt;= 77.5%&lt;/P&gt;&lt;P&gt;And we want to show that we have Specificity &amp;gt;= 77.5%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And we want to have 80% power to show that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus the code in the macro has 77.5 and 22.5, but we want the output that you and I generated to be 80.00.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the run showed 79.08% power with N=470.&amp;nbsp; So what I did was then increase the N to get the power up to 80%, which I achieved at N=480.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the next one I start on is Sensitivity = 85% and Specificity = 86%, and pick a new N to start with and then interate to get to 80% power.&amp;nbsp; But it'll take a long time that way.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 17:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984896#M379755</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T17:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984897#M379756</link>
      <description>&lt;P&gt;Okay, I'm running it right now with "options fullstimer;"&amp;nbsp; I've run it several times in the current SAS session so by this time it may take ten minutes for these proc freqs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When it finally runs, is a better way of getting it into this forum other than just copying and pasting it?&amp;nbsp; I mean, I can copy and paste it no problem but I want to make sure it's readable for you.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 18:04:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984897#M379756</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T18:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984900#M379757</link>
      <description>&lt;P&gt;This menu has several options&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-03-17 131340.png" style="width: 718px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113667i603FF3807DBA5AC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-03-17 131340.png" alt="Screenshot 2026-03-17 131340.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Here to attach files.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-03-17 131443.png" style="width: 648px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113666iFDA402E3B78740FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-03-17 131443.png" alt="Screenshot 2026-03-17 131443.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 18:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984900#M379757</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2026-03-17T18:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984901#M379758</link>
      <description>&lt;P&gt;What client or editor are you using to run this program? SAS EG? SAS Studio? The old Windows Display Manager?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your description, it sounds like some resource is accumulating, which is why the process slows down. If you are seeing output to the log, an ODS output destination, or even the Results window in the old Display Manager. See&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2013/05/24/turn-off-ods-for-simulations.html" target="_blank"&gt;Turn off ODS when running simulations in SAS - The DO Loop&lt;/A&gt;&amp;nbsp;for a discussion and some tricks.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 18:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984901#M379758</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2026-03-17T18:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984902#M379759</link>
      <description>&lt;P&gt;Here is the log with OPTIONS FULLSTIMER;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;143 options fullstimer;&lt;BR /&gt;144 %OBS (0.55, 0.85, 0.85, 450); * 92.05 85.77 79.08 ;&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.X has 4500000 observations and 7 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.31 seconds&lt;BR /&gt;user cpu time 0.26 seconds&lt;BR /&gt;system cpu time 0.04 seconds&lt;BR /&gt;memory 410.68k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:02:59 PM&lt;BR /&gt;Step Count 80 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 2473632 observations read from the data set WORK.X.&lt;BR /&gt;WHERE Gold_Standard='0_POS';&lt;BR /&gt;NOTE: The data set WORK.SENSITIVITY has 2473632 observations and 7 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.36 seconds&lt;BR /&gt;user cpu time 0.34 seconds&lt;BR /&gt;system cpu time 0.04 seconds&lt;BR /&gt;memory 640.37k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:03:00 PM&lt;BR /&gt;Step Count 81 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 2473632 observations read from the data set WORK.SENSITIVITY.&lt;BR /&gt;NOTE: The data set WORK.SENSITIVITY has 2473632 observations and 7 variables.&lt;BR /&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;BR /&gt;real time 0.72 seconds&lt;BR /&gt;user cpu time 0.20 seconds&lt;BR /&gt;system cpu time 0.42 seconds&lt;BR /&gt;memory 237094.53k&lt;BR /&gt;OS Memory 251600.00k&lt;BR /&gt;Timestamp 17/03/2026 02:03:01 PM&lt;BR /&gt;Step Count 82 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.SENSITIVITY2 has 80000 observations and 6 variables.&lt;BR /&gt;NOTE: There were 2473632 observations read from the data set WORK.SENSITIVITY.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 8:16.47&lt;BR /&gt;user cpu time 52.11 seconds&lt;BR /&gt;system cpu time 7:21.62&lt;BR /&gt;memory 1043.09k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:11:17 PM&lt;BR /&gt;Step Count 83 Switch Count 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 80000 observations read from the data set WORK.SENSITIVITY2.&lt;BR /&gt;NOTE: The data set WORK.SENSITIVITY3 has 10000 observations and 7 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;user cpu time 0.01 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 630.81k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:11:17 PM&lt;BR /&gt;Step Count 84 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 10000 observations read from the data set WORK.SENSITIVITY3.&lt;BR /&gt;NOTE: The data set WORK.SENSITIVITY4 has 10000 observations and 7 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.01 seconds&lt;BR /&gt;memory 634.18k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:11:17 PM&lt;BR /&gt;Step Count 85 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 2026368 observations read from the data set WORK.X.&lt;BR /&gt;WHERE Gold_Standard='1_NEG';&lt;BR /&gt;NOTE: The data set WORK.SPECIFICITY has 2026368 observations and 7 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.35 seconds&lt;BR /&gt;user cpu time 0.14 seconds&lt;BR /&gt;system cpu time 0.20 seconds&lt;BR /&gt;memory 640.37k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:11:18 PM&lt;BR /&gt;Step Count 86 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 2026368 observations read from the data set WORK.SPECIFICITY.&lt;BR /&gt;NOTE: The data set WORK.SPECIFICITY has 2026368 observations and 7 variables.&lt;BR /&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;BR /&gt;real time 0.26 seconds&lt;BR /&gt;user cpu time 0.31 seconds&lt;BR /&gt;system cpu time 0.17 seconds&lt;BR /&gt;memory 195177.28k&lt;BR /&gt;OS Memory 210240.00k&lt;BR /&gt;Timestamp 17/03/2026 02:11:18 PM&lt;BR /&gt;Step Count 87 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.SPECIFICITY2 has 80000 observations and 6 variables.&lt;BR /&gt;NOTE: There were 2026368 observations read from the data set WORK.SPECIFICITY.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 9:37.08&lt;BR /&gt;user cpu time 57.09 seconds&lt;BR /&gt;system cpu time 8:36.96&lt;BR /&gt;memory 1063.34k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:20:55 PM&lt;BR /&gt;Step Count 88 Switch Count 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 80000 observations read from the data set WORK.SPECIFICITY2.&lt;BR /&gt;NOTE: The data set WORK.SPECIFICITY3 has 10000 observations and 7 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.01 seconds&lt;BR /&gt;memory 630.81k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:20:55 PM&lt;BR /&gt;Step Count 89 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 10000 observations read from the data set WORK.SPECIFICITY3.&lt;BR /&gt;NOTE: The data set WORK.SPECIFICITY4 has 10000 observations and 7 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;user cpu time 0.01 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 634.18k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:20:55 PM&lt;BR /&gt;Step Count 90 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 10000 observations read from the data set WORK.SENSITIVITY4.&lt;BR /&gt;NOTE: The data set WORK.SENSITIVITY4 has 10000 observations and 7 variables.&lt;BR /&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 4995.68k&lt;BR /&gt;OS Memory 20744.00k&lt;BR /&gt;Timestamp 17/03/2026 02:20:55 PM&lt;BR /&gt;Step Count 91 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 10000 observations read from the data set WORK.SPECIFICITY4.&lt;BR /&gt;NOTE: The data set WORK.SPECIFICITY4 has 10000 observations and 7 variables.&lt;BR /&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.00 seconds&lt;BR /&gt;memory 4995.68k&lt;BR /&gt;OS Memory 20744.00k&lt;BR /&gt;Timestamp 17/03/2026 02:20:55 PM&lt;BR /&gt;Step Count 92 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 10000 observations read from the data set WORK.SENSITIVITY4.&lt;BR /&gt;NOTE: There were 10000 observations read from the data set WORK.SPECIFICITY4.&lt;BR /&gt;NOTE: The data set WORK.SENS_SPEC has 10000 observations and 10 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.01 seconds&lt;BR /&gt;memory 1027.00k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:20:55 PM&lt;BR /&gt;Step Count 93 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 10000 observations read from the data set WORK.SENS_SPEC.&lt;BR /&gt;NOTE: The data set WORK.TEST has 4 observations and 4 variables.&lt;BR /&gt;NOTE: PROCEDURE FREQ used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.01 seconds&lt;BR /&gt;memory 1006.87k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:20:55 PM&lt;BR /&gt;Step Count 94 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 4 observations read from the data set WORK.TEST.&lt;BR /&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;user cpu time 0.00 seconds&lt;BR /&gt;system cpu time 0.01 seconds&lt;BR /&gt;memory 383.00k&lt;BR /&gt;OS Memory 16368.00k&lt;BR /&gt;Timestamp 17/03/2026 02:20:55 PM&lt;BR /&gt;Step Count 95 Switch Count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 18:25:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984902#M379759</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T18:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984903#M379760</link>
      <description>&lt;P&gt;I'm using the old Display Manager.&amp;nbsp; I do have some ODS code, as you can see from where I posted the code for the entire macro, but I'm using that to output the results that I'm subsequently using.&amp;nbsp; Only a two-way proc freq and the four observation dataset generated by it is going to the output window.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 18:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984903#M379760</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T18:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984904#M379761</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;I'm using the old Display Manager. Only a two-way proc freq and the four observation dataset generated by it is going to the output window.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you expand the control widgets for the PROC FREQ in the Results window, you will see that you are generating 2 x 10,000 little control widgets every time you run the macro.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Put&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="sas"&gt;ods noresults;&lt;/PRE&gt;
&lt;P&gt;at the top of your macro and&amp;nbsp;&lt;/P&gt;
&lt;PRE class="sas"&gt;ods results;&lt;/PRE&gt;
&lt;P&gt;at the end.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 18:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984904#M379761</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2026-03-17T18:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984905#M379762</link>
      <description>&lt;P&gt;Holy cow, that's it!&amp;nbsp; I closed SAS and re-opened it and added the two lines you suggested and ran it once and it was about 5% as long as my usual first run after opening SAS.&amp;nbsp; And then I keep running it over and over and it never takes any longer.&amp;nbsp; It's always very fast.&amp;nbsp; Mucho mucho gracias.&amp;nbsp; I had never heard of "ods noresults" and "ods results" before but now I'll never forget them.&amp;nbsp; Thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 18:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984905#M379762</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T18:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984906#M379763</link>
      <description>&lt;P&gt;Chapter 6 "Strategies for Efficient and Effective Simulation" of Wicklin (2013) has a lot of techniques for efficient simulation. Another technique that applies to you is the value of running a small preliminary study (pp. 94-95). In your study, you could initially run 1000 (instead of 10,000) simulations while you develop and debug the program, and as you search for the optimal parameter values. That will enable you to conjecture that the optimal sample size is approximately &lt;SPAN&gt;N=470. You can then increase the number of simulations to 10,000&amp;nbsp;&lt;/SPAN&gt;and re-run the simulations for a limited range of sample sizes such as [465, 475].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To quote Wicklin, p. 95:&lt;BR /&gt;&lt;EM&gt;In summary, when you begin a large simulation study, resist the urge to immediately write and&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;run the entire simulation. Start small. Debug and optimize the simple cases. Run a small-scale&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;simulation. These techniques provide important information that you can incorporate into the final&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;study.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 19:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984906#M379763</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2026-03-17T19:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS runs slower with each macro call simulated power</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984907#M379764</link>
      <description>&lt;P&gt;That's a good idea, thanks, I'll remember it.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 19:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-runs-slower-with-each-macro-call-simulated-power/m-p/984907#M379764</guid>
      <dc:creator>n6b</dc:creator>
      <dc:date>2026-03-17T19:38:34Z</dc:date>
    </item>
  </channel>
</rss>

