<?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: macro proc genmod in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264032#M51732</link>
    <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh﻿&lt;/a&gt;&amp;nbsp;you are doing very good coding. now i got it and i like it although the list contains all veriables and thier values either significant or insignificant.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2016 22:38:24 GMT</pubDate>
    <dc:creator>samnan</dc:creator>
    <dc:date>2016-04-14T22:38:24Z</dc:date>
    <item>
      <title>macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263879#M51670</link>
      <description>&lt;P&gt;Hi;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one exposure (exp), 4&amp;nbsp;dependants (dep) and 9 independants (indp) and i want to run&amp;nbsp;proc genmod. the exposure will present with each independant to model each dependant. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example modeling the first dependant:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc genmod data=have;&lt;/P&gt;&lt;P&gt;model dep1 = exp indp1 /d=nb;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc genmod data=have;&lt;/P&gt;&lt;P&gt;model dep1 = exp indp2&amp;nbsp;/d=nb;run;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;proc genmod data=have;&lt;/P&gt;&lt;P&gt;model dep1 = exp indp9&amp;nbsp;/d=nb;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then the same for the other dependants.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i belive using macro will save the time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any hlep would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 14:01:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263879#M51670</guid>
      <dc:creator>samnan</dc:creator>
      <dc:date>2016-04-14T14:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263886#M51673</link>
      <description>&lt;P&gt;Not too familiar with that procedure, however all procedures allow by group processing - which would be both easier to maintain and less resource hungry. &amp;nbsp;Change your input data structure slightly - you can use transpose - normalised data is easier to work with:&lt;/P&gt;
&lt;P&gt;You have:&lt;/P&gt;
&lt;P&gt;... INDP1 &amp;nbsp;INDP2 INDP3 ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; xyz &amp;nbsp; &amp;nbsp; &amp;nbsp; xyz &amp;nbsp; &amp;nbsp; &amp;nbsp;xyz&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change this to:&lt;/P&gt;
&lt;P&gt;... INDP &amp;nbsp; RES&lt;/P&gt;
&lt;P&gt;... &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xyz&lt;/P&gt;
&lt;P&gt;... &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; xyz&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can do one gemod:&lt;/P&gt;
&lt;PRE&gt;proc genmod data=have;
  by indp;
  model dep1 = exp res /d=nb;
run;&lt;/PRE&gt;
&lt;P&gt;Sorry, not sure how this affects the model, can only advise on structure and syntax.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263886#M51673</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-14T16:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263903#M51680</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your MODEL statement, &lt;FONT face="courier new,courier"&gt;indp&lt;/FONT&gt;&amp;nbsp;should&amp;nbsp;read &lt;FONT face="courier new,courier"&gt;res&lt;/FONT&gt; to make sense.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 15:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263903#M51680</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-14T15:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263911#M51682</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/68263"&gt;@samnan﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally, I prefer analysis datasets in wide format (like your HAVE dataset) for statistical modelling procedures. All variables occurring in one MODEL statement must be available anyway in the input dataset.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;With your existing dataset HAVE, your "macro" can be implemented using CALL EXECUTE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
array dep dep1 dep2 ...; /* list your dependent variables here */
array indp indp1 indp2 ...; /* list your independent variables here */
do i=1 to dim(dep);
  do j=1 to dim(indp);
    call execute( 'proc genmod data=have; '
               || 'model ' || vname(dep[i]) || ' = exp ' || vname(indp[j]) || ' /d=nb; run;');
  end;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This assumes that all your independent variables are numeric (which is plausible as you didn't mention a CLASS statement). Please note that the arrays above do &lt;EM&gt;not&lt;/EM&gt; contain variables from dataset HAVE, but just "dummy variables" with the same names.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 15:48:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263911#M51682</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-14T15:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263912#M51683</link>
      <description>&lt;P&gt;Thanks, updated.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:05:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263912#M51683</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-14T16:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263921#M51687</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;&amp;nbsp;thanks for your valuable help, i do not have (res) variable. but the code provided by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh﻿&lt;/a&gt;&amp;nbsp;works good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:26:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263921#M51687</guid>
      <dc:creator>samnan</dc:creator>
      <dc:date>2016-04-14T16:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263924#M51688</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh﻿&lt;/a&gt;&amp;nbsp;thanks for your appreciated help,&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263924#M51688</guid>
      <dc:creator>samnan</dc:creator>
      <dc:date>2016-04-14T16:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263978#M51711</link>
      <description>&lt;P&gt;Can you&amp;nbsp;take it one step further, where to let macro keep significant (indp) variables only. just to make it like (selection) option in logistic regression modeling.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/263978#M51711</guid>
      <dc:creator>samnan</dc:creator>
      <dc:date>2016-04-14T19:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264016#M51723</link>
      <description>&lt;P&gt;So, you'd run the 4&lt;FONT face="symbol"&gt;*&lt;/FONT&gt;9 PROC GENMOD steps (via CALL EXECUTE) and for each of the four dependent variables you would like to have a list of those independent variables which had p-values &amp;lt;0.05 in table "Analysis Of Maximum Likelihood Parameter Estimates," excluding variable EXP, which is always in the model?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, this is possible. You could write the parameter estimates (incl. p-values) to datasets EST_DEP1, EST_DEP2, ... (where "DEP&lt;EM&gt;i&lt;/EM&gt;" would be replaced by the name of the &lt;EM&gt;i&lt;/EM&gt;-th dependent variable) and then, for example, select the names of the&amp;nbsp;independent variables of interest via PROC SQL into macro variables INDPLIST_DEP1,&amp;nbsp;&lt;SPAN&gt;INDPLIST_DEP2, ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is draft code for this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
array dep dep1 dep2 ...; /* list your dependent variables here */
array indp indp1 indp2 ...; /* list your independent variables here */
do i=1 to dim(dep);
  call execute('ods output ParameterEstimates(persist=proc)=est_' || vname(dep[i]) ||';');
  do j=1 to dim(indp);
    call execute( 'proc genmod data=have;'
               || 'model ' || vname(dep[i]) || ' = exp ' || vname(indp[j]) || ' /d=nb; run;');
  end;
  call execute('ods output close;');
  call execute('proc sql noprint; select parameter into :indplist_' || vname(dep[i])
            || ' separated by " " from est_' || vname(dep[i])
            || ' where upcase(parameter) not in ("INTERCEPT", "EXP", "DISPERSION") &amp;amp; .&amp;lt;ProbChiSq&amp;lt;0.05; quit;');
end;
run;

%put &amp;amp;=indplist_dep1; /* replace dep1 by the name of the first dep. variable */
%put &amp;amp;=indplist_dep2; /* replace dep1 by the name of the second dep. variable */
...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;You could use the variable lists &amp;amp;indplist_&lt;EM&gt;depi&lt;/EM&gt; in MODEL statements of&amp;nbsp;subsequent PROC GENMOD calls.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As I said, this is draft code. If for a particular dependent variable none of the 9 independent variables (excl. EXP) turned out to be significant, the corresponding macro variable would not be created (hence, the corresponding %PUT statement would cause a WARNING in the log).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 21:03:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264016#M51723</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-14T21:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264024#M51726</link>
      <description>&lt;P&gt;i am not sure about last part (%put &amp;amp;=indplist_dep1; /* replace dep1 by the name of the first dep. variable */&lt;BR /&gt;).&lt;/P&gt;&lt;P&gt;i rename my dependant variable to (dep, dep1 ... dep7) and the indepdendant variables to (indp, indp1 .... indp16) just to apply the code.&amp;nbsp;when i run it this time it showed the&amp;nbsp;same results of old one.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 21:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264024#M51726</guid>
      <dc:creator>samnan</dc:creator>
      <dc:date>2016-04-14T21:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264029#M51729</link>
      <description>&lt;P&gt;The %PUT statements are just optional to demonstrate that the variable lists have been&amp;nbsp;created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note that my comments "list your (in)dependent variables here" referred to the lists &lt;FONT face="courier new,courier"&gt;dep1 dep2 ...&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;indp1 indp2 ...&lt;/FONT&gt;, respectively. The names &lt;FONT face="courier new,courier"&gt;dep&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;indp&lt;/FONT&gt; are the array names and must not be replaced. So, for instance, if your independent variables were AGE,&amp;nbsp;HEIGHT, WEIGHT, the second array statement would read:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array indp age height weight;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and similarly for the first array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the first dependent variable was XYZ and only AGE and WEIGHT were significant for that, the suggested code would create a macro variable INDPLIST_XYZ containing &lt;FONT face="courier new,courier"&gt;age weight&lt;/FONT&gt; (possibly in upper or mixed case), selected from a WORK dataset named EST_XYZ.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 22:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264029#M51729</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-14T22:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264032#M51732</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh﻿&lt;/a&gt;&amp;nbsp;you are doing very good coding. now i got it and i like it although the list contains all veriables and thier values either significant or insignificant.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 22:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264032#M51732</guid>
      <dc:creator>samnan</dc:creator>
      <dc:date>2016-04-14T22:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264034#M51733</link>
      <description>&lt;P&gt;What do you mean by "&lt;SPAN&gt;the list contains all veriables and thier values either significant or insignificant"? Are you saying that some or all of the macro variables INDPLIST_&lt;EM&gt;depi&lt;/EM&gt; do not contain the correct variable lists? If anything does not work or is unclear, we can continue the discussion tomorrow (Central European Time).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 22:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264034#M51733</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-14T22:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264115#M51766</link>
      <description>&lt;P&gt;RES is just a variable name I created, when the data is taken from going along the table, i.e. they are variables your data looks like this:&lt;/P&gt;
&lt;P&gt;... INDP1 &amp;nbsp; INDP2 &amp;nbsp; INDP3 ...&lt;/P&gt;
&lt;P&gt;... xyz &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;def &amp;nbsp; &amp;nbsp; &amp;nbsp; abc &amp;nbsp; &amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the data is normalised it would look like this:&lt;/P&gt;
&lt;P&gt;... &amp;nbsp;INDP &amp;nbsp;RES (call these columns what you want)...&lt;/P&gt;
&lt;P&gt;... &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xyz...&lt;/P&gt;
&lt;P&gt;... &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;def...&lt;/P&gt;
&lt;P&gt;... &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;abc...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second structure - exactly the same data, just in a different layout - is both easier to program with, uses core Base SA functionality of by group processing which is quicker and just generally better in all respsects. &amp;nbsp;It is a useful thing to note that a slight restructure to your data can make your programming more efficient and easier to read and maintain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 08:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264115#M51766</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-15T08:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264179#M51784</link>
      <description>&lt;P&gt;what i meant is that the (%put &amp;amp;=indplist_indp1) contains all independant variables (indp1 .. indp16) regardless of their P-value. I thought the list contains only&amp;nbsp;significant variables (if the P-value &amp;lt; 0.05).&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 14:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264179#M51784</guid>
      <dc:creator>samnan</dc:creator>
      <dc:date>2016-04-15T14:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264180#M51785</link>
      <description>&lt;P&gt;Ithink that because of the follwoing:&lt;/P&gt;&lt;P&gt;first let explain here what i got in the list in terms of the (parameter):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Intercept&lt;/P&gt;&lt;P&gt;exp&lt;/P&gt;&lt;P&gt;indp1&lt;/P&gt;&lt;P&gt;Dispersion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;usualy the (Intercept) or the (exp) P-value turns to be significant (p-value &amp;lt; 0.05), so it will be included to the list even if the (indp1) insignificant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 14:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264180#M51785</guid>
      <dc:creator>samnan</dc:creator>
      <dc:date>2016-04-15T14:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264192#M51793</link>
      <description>&lt;P&gt;How can Intercept etc. and non-significant variables be included, given the WHERE&amp;nbsp;clause&lt;/P&gt;
&lt;PRE&gt; where upcase(parameter) not in ("INTERCEPT", "EXP", "DISPERSION") &amp;amp; .&amp;lt;ProbChiSq&amp;lt;0.05;&lt;/PRE&gt;
&lt;P&gt;in the PROC SQL code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had tested my code successfully using a subset of SASHELP.CARS as dataset HAVE. Here is a short section from the log:&lt;/P&gt;
&lt;PRE&gt;NOTE: Algorithm converged.
NOTE: The negative binomial dispersion parameter was estimated by maximum likelihood.
NOTE: PROCEDURE GENMOD used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


4   + ods output close;
NOTE: The data set WORK.EST_INVOICE has 8 observations and 10 variables.
5   + proc sql noprint;
5   +                   select parameter into :indplist_invoice separated by " " from est_invoice where upcase(parameter) not in
("INTERCEPT", "HORSEPOWER", "DISPERSION") &amp;amp; .&amp;lt;ProbChiSq&amp;lt;0.05;
5   +
 quit;
NOTE: PROCEDURE SQL used (Total process time):&lt;/PRE&gt;
&lt;P&gt;A comparison of the above log excerpt with a corresponding section of&amp;nbsp;your SAS log (one such section per dependent variable)&amp;nbsp;will be a promising first step&amp;nbsp;towards finding the issue at your end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, the names "INVOICE" and "HORSEPOWER" are data-specific. The dataset WORK.EST_&lt;EM&gt;yourvariablename&lt;/EM&gt; will show what the PROC SQL step should have written into&amp;nbsp;the pertinent macro variable INDPLIST_&lt;EM&gt;yourvariablename&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 14:58:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264192#M51793</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-15T14:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264250#M51814</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh﻿&lt;/a&gt;&amp;nbsp;i have tried many times but could not got it; Please find my sample below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;infile cards dlm=" ";&lt;BR /&gt;input res trans commn commr busn totacc facc fsacc exp;&lt;BR /&gt;cards;&lt;BR /&gt;0.5106 0.00592 0.00204 0.04674 0.01549 1561 8 45 14.6401&lt;BR /&gt;0.54689 0.00368 0.00104 0.01984 0.00878 1293 6 50 14.5009&lt;BR /&gt;0.55426 0.00755 0.00368 0.01085 0.0197 1283 6 27 13.7799&lt;BR /&gt;0.78301 0.00229 0.00246 0.03242 0.02246 1399 3 25 13.9239&lt;BR /&gt;0.52035 0.00555 0.00813 0.00985 0.0148 835 3 24 13.8535&lt;BR /&gt;0.52406 0.00045 0.00179 0.01541 0.00757 784 5 15 14.4113&lt;BR /&gt;0.54079 0.01462 0.05013 0.01628 0.02279 936 4 13 14.0026&lt;BR /&gt;0.0878 0.00312 0.00011 0.00942 0.0025 1034 5 16 14.1336&lt;BR /&gt;0.04896 0.00157 0.04674 0.11843 0.0066 1179 8 25 13.9206&lt;BR /&gt;0.41158 0.00399 0.00734 0.25723 0.02834 1893 2 31 13.7067&lt;BR /&gt;0.62409 0.00807 0.00253 0.03514 0.00633 1699 7 49 13.821&lt;BR /&gt;0.34779 0.0289 0.05937 0.04541 0.02666 1900 9 39 14.9494&lt;BR /&gt;0.57421 0.00915 0.00181 0.03558 0.00675 1402 3 42 13.9342&lt;BR /&gt;0.68064 0.00395 0.0007 0.08047 0.02416 376 0 5 12.6189&lt;BR /&gt;0.38445 0.01718 0.00134 0.05237 0.0705 1623 11 42 14.7249&lt;BR /&gt;0.71162 0.00409 0.00075 0.02756 0.0264 1433 2 14 14.0926&lt;BR /&gt;0.51897 0.00997 0.00074 0.04778 0.03209 5088 11 71 14.894&lt;BR /&gt;0.63653 0.00411 0.00374 0.0487 0.0202 2044 7 51 14.6865&lt;BR /&gt;0.31564 0.00522 0.00018 0.01399 0.04705 1005 3 20 13.9002&lt;BR /&gt;0.35732 0.00522 0.00208 0.04063 0.02346 5741 34 157 15.3313&lt;BR /&gt;0.75071 0.01419 0.00551 0.02774 0.01832 980 4 25 13.9193&lt;BR /&gt;0.30134 0 0.00008 0.00945 0.00451 671 7 27 14.004&lt;BR /&gt;0.24283 0.00123 0.01685 0.00348 0.00336 564 2 10 14.074&lt;BR /&gt;0.46881 0.00231 0.00829 0.01293 0.03569 700 1 5 13.7692&lt;BR /&gt;0.03949 0.01613 0 0.00055 0.00081 407 1 6 13.2234&lt;BR /&gt;0.04287 0.00561 0.04142 0.01772 0.01949 4436 34 99 15.0589&lt;BR /&gt;0.32452 0.01828 0.00561 0.08055 0.01413 9017 40 162 15.1009&lt;BR /&gt;0.01545 0.00422 0.00205 0.00982 0.03275 2866 39 114 15.7243&lt;BR /&gt;0.05259 0.00144 0.08136 0.00561 0.01251 227 1 5 13.9364&lt;BR /&gt;0.0216 0.00012 0.00009 0.02055 0.012 2757 11 61 14.2239&lt;BR /&gt;0.01964 0.00341 0.00691 0.00493 0.00128 41 0 0 14.2912&lt;BR /&gt;0.02977 0.00424 0.01542 0.00407 0.00895 1440 10 35 14.6687&lt;BR /&gt;0.49944 0.01248 0.01842 0.01607 0.00833 332 1 4 11.7664&lt;BR /&gt;0.57083 0.0105 0.00156 0.12008 0.0259 759 3 13 13.136&lt;BR /&gt;0.00176 0.0002 0.01181 0.00386 0.00292 1784 43 126 15.3832&lt;BR /&gt;0.01671 0.00037 0.00009 0.00096 0.00116 234 1 6 11.4916&lt;BR /&gt;0.02278 0.00003 0.00231 0.0088 0.00024 3272 48 142 14.6535&lt;BR /&gt;0.07297 0 0.01172 0 0 62 0 1 9.2823&lt;BR /&gt;0.44657 0.06945 0.02416 0.05744 0.12574 1536 3 22 14.0376&lt;BR /&gt;0.00054 0 0 0 0.00008 655 14 39 12.7758&lt;BR /&gt;0.69536 0.01753 0.00429 0.03601 0.01435 1934 5 37 14.3894&lt;BR /&gt;0.49895 0.00396 0 0.26858 0.01808 354 4 14 12.1618&lt;BR /&gt;0.02764 0.00178 0.04852 0.01417 0.02677 5776 30 134 15.0845&lt;BR /&gt;0.00177 0.0002 0.00037 0.00006 0.00003 126 2 2 11.8863&lt;BR /&gt;0.45239 0.01005 0.00076 0.00014 0.01328 1246 4 31 14.4243&lt;BR /&gt;0.13396 0.00224 0.01808 0.0079 0.00452 5140 45 240 15.2573&lt;BR /&gt;0 0.0708 0 0 0 1272 9 45 13.0868&lt;BR /&gt;0.55166 0.01672 0.00734 0.04716 0.00758 2015 12 61 14.5673&lt;BR /&gt;0.49025 0.01888 0.01895 0.04154 0.07337 1777 5 18 14.0023&lt;BR /&gt;0.10641 0.00109 0.00371 0.03058 0.00735 3680 17 111 15.4036&lt;BR /&gt;;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;array dep totacc facc fsacc;&lt;BR /&gt;array indp res trans commn commr busn;&lt;BR /&gt;do i=1 to dim(dep);&lt;BR /&gt;call execute('ods output ParameterEstimates(persist=proc)=est_' || vname(dep[i]) ||';');&lt;BR /&gt;do j=1 to dim(indp);&lt;BR /&gt;call execute( 'proc genmod data=have;'&lt;BR /&gt;|| 'model ' || vname(dep[i]) || ' = exp ' || vname(indp[j]) || ' /d=nb; run;');&lt;BR /&gt;end;&lt;BR /&gt;call execute('ods output close;');&lt;BR /&gt;call execute('proc sql noprint; select parameter into :indplist_' || vname(dep[i])&lt;BR /&gt;|| ' separated by " " from est_' || vname(dep[i])&lt;BR /&gt;|| ' where upcase(parameter) not in ("INTERCEPT", "EXP", "DISPERSION") &amp;amp; .&amp;lt;ProbChiSq&amp;lt;0.05; quit;');&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;=indplist_totacc ;&lt;BR /&gt;%put &amp;amp;=indplist_facc ;&lt;BR /&gt;%put &amp;amp;=indplist_fsacc;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 18:49:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264250#M51814</guid>
      <dc:creator>samnan</dc:creator>
      <dc:date>2016-04-15T18:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264261#M51815</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/68263"&gt;@samnan﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for posting this realistic example. Good news: I've run your code and found that, as far as I see,&amp;nbsp;&lt;STRONG&gt;all results are correct and as expected&lt;/STRONG&gt;. The only WARNING message is the one I announced already in &lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/macro-proc-genmod/m-p/264016#M51723" target="_blank"&gt;this earlier post&lt;/A&gt;:&amp;nbsp;There are&amp;nbsp;no significant predictors for TOTACC among the five candidate variables, hence macro variable INDPLIST_TOTACC is not created and the %PUT statement is not applicable. (We could create it as an empty macro variable if needed.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other two macro variables contain the lists of (at the 0.05 level)&amp;nbsp;significant independent variables:&lt;/P&gt;
&lt;PRE&gt;INDPLIST_FACC=res busn
INDPLIST_FSACC=busn&lt;/PRE&gt;
&lt;P&gt;These results are in accordance with the datasets EST_TOTACC, EST_FACC and EST_FSACC, which were produced correctly with the expected 20 observations each (=4 obs. for each of the 5 indep. variables).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you get anything different or what is it that you "could not [get]" although you "have tried many times"?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 19:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264261#M51815</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-04-15T19:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: macro proc genmod</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264262#M51816</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;&amp;nbsp;thanks for your explanation, i will try it&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 19:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-proc-genmod/m-p/264262#M51816</guid>
      <dc:creator>samnan</dc:creator>
      <dc:date>2016-04-15T19:16:18Z</dc:date>
    </item>
  </channel>
</rss>

