<?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: Ods output in a Macro program - please help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAcro-for-logistic-regression-model/m-p/57714#M12493</link>
    <description>I guess I have a trouble with Ods Ouput now, the macro for LR works.&lt;BR /&gt;
&lt;BR /&gt;
I used the similar ods output to collect pvalues in the PHREG statement and it was totally fine, but now I am given the error message that the variable 'Parameter' has never been referenced. Also I am getting this WARNING: Duplicate data set name on ODS OUTPUT statement. Entry will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
here is my program: &lt;BR /&gt;
&lt;BR /&gt;
%MACRO logistic;&lt;BR /&gt;
%local I;&lt;BR /&gt;
&lt;BR /&gt;
%DO I=1 %TO x;&lt;BR /&gt;
&lt;BR /&gt;
ods output  ParameterEstimates=Results; &lt;BR /&gt;
&lt;BR /&gt;
DATA a; SET b; df=d*f; RUN;&lt;BR /&gt;
&lt;BR /&gt;
proc logistic descending data=a;&lt;BR /&gt;
&lt;BR /&gt;
MODEL y=d f df e.. ;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
ods OUTPUT close;&lt;BR /&gt;
&lt;BR /&gt;
 DATA Estimate; SET Results; WHERE Parameter="df"; KEEP Parameter&lt;BR /&gt;
 ProbChiSq ; RUN; &lt;BR /&gt;
&lt;BR /&gt;
DATA PVALUE; SET PVALUE Estimate; RUN; &lt;BR /&gt;
%END;&lt;BR /&gt;
%MEND logistic;&lt;BR /&gt;
%logistic;</description>
    <pubDate>Fri, 30 Jul 2010 16:03:13 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-07-30T16:03:13Z</dc:date>
    <item>
      <title>SAS MAcro for logistic regression model</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAcro-for-logistic-regression-model/m-p/57711#M12490</link>
      <description>Hi, I am not sure how to write macro for a LR program where&lt;BR /&gt;
proc logistic descending;&lt;BR /&gt;
model y=x a b c d ..; run;&lt;BR /&gt;
&lt;BR /&gt;
yet I need many iterative steps for the variable x that starts with 'rs' and then the number.&lt;BR /&gt;
&lt;BR /&gt;
can u please help? !!&lt;BR /&gt;
&lt;BR /&gt;
Thanks much</description>
      <pubDate>Thu, 29 Jul 2010 20:59:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-MAcro-for-logistic-regression-model/m-p/57711#M12490</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-29T20:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS MAcro for logistic regression model</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAcro-for-logistic-regression-model/m-p/57712#M12491</link>
      <description>I think you are asking to insert a series of model statements into your PROC LOGISTIC step.  The following untested macro allows you to build as many MODEL statements as you need (the default is 10 and the macro call requests 25).&lt;BR /&gt;
&lt;BR /&gt;
[pre]%macro logistic(models=10);&lt;BR /&gt;
   %local i;&lt;BR /&gt;
   proc logistic data=mydata descending;&lt;BR /&gt;
      %do i = 1 %to &amp;amp;models;&lt;BR /&gt;
         rs&amp;amp;i: model y = rs&amp;amp;i a b c d;&lt;BR /&gt;
      %end;&lt;BR /&gt;
      run;&lt;BR /&gt;
%mend logistic;&lt;BR /&gt;
%logistic(models=25)&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 30 Jul 2010 02:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-MAcro-for-logistic-regression-model/m-p/57712#M12491</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-07-30T02:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS MAcro for logistic regression model</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAcro-for-logistic-regression-model/m-p/57713#M12492</link>
      <description>I think your macro probably works but PROC LOGISTIC does not allow multiple model statements like PROC REG.  V 9.1.3 anyway.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
421  proc logistic data=sashelp.class descending;&lt;BR /&gt;
422     weight: model sex = weight;&lt;BR /&gt;
423     height: model sex = height;&lt;BR /&gt;
424     run;&lt;BR /&gt;
&lt;BR /&gt;
ERROR: Only one MODEL statement can be used with each invocation of PROC LOGISTIC.&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
I find that for a situation that the OP describes it is more satisfying to fiddle with the data and use a BY statement than to fiddle with macros.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data class;&lt;BR /&gt;
   set sashelp.class;&lt;BR /&gt;
   array rs[10];&lt;BR /&gt;
   do _n_ = 1 to dim(rs);&lt;BR /&gt;
      rs[_n_] = ranuni(123);&lt;BR /&gt;
      end;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc transpose data=class out=tclass;&lt;BR /&gt;
   by name sex age weight height;&lt;BR /&gt;
   var rs:;&lt;BR /&gt;
   run;&lt;BR /&gt;
data tclass;&lt;BR /&gt;
   set tclass;&lt;BR /&gt;
   order = input(substr(_name_,3),8.);&lt;BR /&gt;
   run;&lt;BR /&gt;
proc sort data=tclass;&lt;BR /&gt;
   by order;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc logistic data=tclass;&lt;BR /&gt;
   by _name_ notsorted;&lt;BR /&gt;
   model sex = col1 age weight height;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
You don't have to create the ORDER variable but without it RS1 is followed by RS10 and you probably prefer RS2 to follow RS1.</description>
      <pubDate>Fri, 30 Jul 2010 11:06:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-MAcro-for-logistic-regression-model/m-p/57713#M12492</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-07-30T11:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Ods output in a Macro program - please help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-MAcro-for-logistic-regression-model/m-p/57714#M12493</link>
      <description>I guess I have a trouble with Ods Ouput now, the macro for LR works.&lt;BR /&gt;
&lt;BR /&gt;
I used the similar ods output to collect pvalues in the PHREG statement and it was totally fine, but now I am given the error message that the variable 'Parameter' has never been referenced. Also I am getting this WARNING: Duplicate data set name on ODS OUTPUT statement. Entry will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
here is my program: &lt;BR /&gt;
&lt;BR /&gt;
%MACRO logistic;&lt;BR /&gt;
%local I;&lt;BR /&gt;
&lt;BR /&gt;
%DO I=1 %TO x;&lt;BR /&gt;
&lt;BR /&gt;
ods output  ParameterEstimates=Results; &lt;BR /&gt;
&lt;BR /&gt;
DATA a; SET b; df=d*f; RUN;&lt;BR /&gt;
&lt;BR /&gt;
proc logistic descending data=a;&lt;BR /&gt;
&lt;BR /&gt;
MODEL y=d f df e.. ;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
ods OUTPUT close;&lt;BR /&gt;
&lt;BR /&gt;
 DATA Estimate; SET Results; WHERE Parameter="df"; KEEP Parameter&lt;BR /&gt;
 ProbChiSq ; RUN; &lt;BR /&gt;
&lt;BR /&gt;
DATA PVALUE; SET PVALUE Estimate; RUN; &lt;BR /&gt;
%END;&lt;BR /&gt;
%MEND logistic;&lt;BR /&gt;
%logistic;</description>
      <pubDate>Fri, 30 Jul 2010 16:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-MAcro-for-logistic-regression-model/m-p/57714#M12493</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-30T16:03:13Z</dc:date>
    </item>
  </channel>
</rss>

