<?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: How to make PROC LOGISTIC work when pprob is a variable, not a number in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472460#M24594</link>
    <description>Hi Irudolphi,&lt;BR /&gt;&lt;BR /&gt;I actually went back to the log and the ERROR message has changed, now it is displaying the following message:&lt;BR /&gt;"Matrix has not been set to a value".&lt;BR /&gt;So I guess the SYSEVALF worked.&lt;BR /&gt;Any ideas what may be causing the new error? Thanks a lot!</description>
    <pubDate>Fri, 22 Jun 2018 12:52:50 GMT</pubDate>
    <dc:creator>marianaalcos</dc:creator>
    <dc:date>2018-06-22T12:52:50Z</dc:date>
    <item>
      <title>How to make PROC LOGISTIC work when pprob is a variable, not a number</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472441#M24590</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My task is very simple. I'm using PROC LOGISTIC with the argument ctable and pprob.&lt;/P&gt;&lt;P&gt;If I use pprob=0.5 (a number) my procedure runs. However, whenever I try an expression (say 10/100 or, more interestingly, a variable's name inside an expression like i/100) SAS returns the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError focus-line"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR 22-322: Syntax error, expecting one of the following: a numeric constant, a datetime constant, (.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasError focus-line"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError focus-line"&gt;I need to use this inside a macro and vary the values of pprobs from 0.01 to 1.&amp;nbsp;I've attached code (in SAS Studio) and data. The part that does not run is the very last (the logistic_macro).&lt;/DIV&gt;&lt;DIV class="sasError focus-line"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError focus-line"&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro logistic_macro; 
	%do i = 1 %to 100;
     	proc logistic data=WORK.GLMDesign outmodel=final_model noprint;
		class Col3 Col4 Col7 Col8 Col9 Col13 Col22 Col23 Col27 Col28 / param=glm;
		model VAR21(event='1')= Col3 Col4 Col7 Col8 Col9 Col13 Col22 Col23 Col27 Col28
			Col2  / link=logit technique=fisher ctable  pprob=%EVAL(&amp;amp;i./100) ;
		output out=preds predprobs=individual;
		score data=testset out=TestPred_new;
		run;
		proc freq data=TestPred_new;
    	table VAR21*I_VAR21 / out=CellCounts_new noprint;
		run;
		proc iml; /* using matrix language like in HW06 to make our lives easier */
		loss= j(100, 1, 0);  /*vector to store loss for different thresholds */
		use work.CellCounts_new; 
		read all var _ALL_ into M;
		close work.CellCounts_new;
		FalsePos = M[2,2] # 5; 
		FalseNeg = M[3,2]; 
		loss[i] = FalsePos + FalseNeg;
		print loss;
     %end; 
%mend;

%logistic_macro; *runs the macro;&lt;/CODE&gt;&lt;/PRE&gt;I appreciate your help as usual!&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Jun 2018 11:18:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472441#M24590</guid>
      <dc:creator>marianaalcos</dc:creator>
      <dc:date>2018-06-22T11:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to make PROC LOGISTIC work when pprob is a variable, not a number</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472450#M24591</link>
      <description>&lt;P&gt;%EVAL won't give you the decimal accuracy that you need. Try %SYSEVALF instead.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let i=1;
%put %EVAL(&amp;amp;i./100);
%put %SYSEVALF(&amp;amp;i./100);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you were to run the above, here are the results printed to the log:&lt;/P&gt;&lt;P&gt;0&lt;BR /&gt;0.01&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 12:24:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472450#M24591</guid>
      <dc:creator>lrudolphi</dc:creator>
      <dc:date>2018-06-22T12:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to make PROC LOGISTIC work when pprob is a variable, not a number</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472452#M24592</link>
      <description>Hi lrudolphi,&lt;BR /&gt;&lt;BR /&gt;Thanks for the comments, but I still got the same error. I had actually tried SYSEVALF before with put, but it seems that the argument pprob will not accept it =/&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Jun 2018 12:30:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472452#M24592</guid>
      <dc:creator>marianaalcos</dc:creator>
      <dc:date>2018-06-22T12:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to make PROC LOGISTIC work when pprob is a variable, not a number</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472456#M24593</link>
      <description>&lt;P&gt;That's strange. I just tried it with dummy data and it worked for me, meaning changing the option to&lt;/P&gt;&lt;P&gt;pprob=%SYSEVALF(&amp;amp;i./100)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 12:37:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472456#M24593</guid>
      <dc:creator>lrudolphi</dc:creator>
      <dc:date>2018-06-22T12:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to make PROC LOGISTIC work when pprob is a variable, not a number</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472460#M24594</link>
      <description>Hi Irudolphi,&lt;BR /&gt;&lt;BR /&gt;I actually went back to the log and the ERROR message has changed, now it is displaying the following message:&lt;BR /&gt;"Matrix has not been set to a value".&lt;BR /&gt;So I guess the SYSEVALF worked.&lt;BR /&gt;Any ideas what may be causing the new error? Thanks a lot!</description>
      <pubDate>Fri, 22 Jun 2018 12:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472460#M24594</guid>
      <dc:creator>marianaalcos</dc:creator>
      <dc:date>2018-06-22T12:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to make PROC LOGISTIC work when pprob is a variable, not a number</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472468#M24595</link>
      <description>Apologies, I am not too familiar with proc iml, so unfortunately cannot help solve that part. Glad the other part worked, though!</description>
      <pubDate>Fri, 22 Jun 2018 13:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472468#M24595</guid>
      <dc:creator>lrudolphi</dc:creator>
      <dc:date>2018-06-22T13:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to make PROC LOGISTIC work when pprob is a variable, not a number</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472470#M24596</link>
      <description>That's okay, I guess I'll just post a new question, because I used proc iml outside the macro and it worked. Thanks anyways!</description>
      <pubDate>Fri, 22 Jun 2018 13:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-make-PROC-LOGISTIC-work-when-pprob-is-a-variable-not-a/m-p/472470#M24596</guid>
      <dc:creator>marianaalcos</dc:creator>
      <dc:date>2018-06-22T13:12:11Z</dc:date>
    </item>
  </channel>
</rss>

