<?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: Help for a macro that merges files with proc SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688238#M209032</link>
    <description>&lt;P&gt;It still bothers me that you keep saying "impute" and I am about to show the method to make predictions. So, are we really talking about the same thing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_plm_examples01.htm&amp;amp;locale=en" target="_self"&gt;example&lt;/A&gt; of PROC LOGISTIC, creating a model and storing the regression using the STORE statement. This is followed by a test data set being created and then PROC PLM uses the test data set and the STORE data set, but not the original data, to get predictions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this to work, you have to have access to SAS/STAT.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2020 14:52:37 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-10-01T14:52:37Z</dc:date>
    <item>
      <title>Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688188#M209013</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have this code that merges regression parameters (param.lfp) to an micro dataset (pop_lfp1). The regression file is organised in a way that each&amp;nbsp;variable has its own column with their specific categories on different lines and parameters corresponding to these categories being on another column (see attached file). The point of the merge is to have for each individuals of pop_lfp1 the regression parameters that correspond to their own characteristics. Since the code is repeating for each variable (intercept, edu, agegr, etc.), I'd like to have a macro that makes it shorter, in which I could just declare variables to merge in parameters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	proc sql;
	  create table pop_lfp1 as
	    select 
	      p.*,
	      t1.intercept, t2.edu_p, t3.agegr_p, t4.agegr_edu_p,
	      t5.young_kid_p, t6.young_kid_edu_p, t7.region_p
	     
	    from 
	      pop2 p
	
	      left join
	      ( select sex, intercept
	        from param.lfp
	        where not missing(intercept)
	      ) t1
	      on p.sex=t1.sex
	      
	      left join
	      ( select sex, edu, edu_p
	        from param.lfp
	        where not missing(edu_p)
	      )t2
	      on p.sex=t2.sex and p.edu=t2.edu
	      
	      left join
	      ( select sex, agegr, agegr_p
	        from param.lfp
	        where not missing(agegr_p)
	      )t3
	      on p.sex=t3.sex and p.agegr=t3.agegr
	      
	      left join
	      ( select sex, agegr, edu, agegr_edu_p
	        from param.lfp
	        where not missing(agegr_edu_p)
	      )t4
	      on p.sex=t4.sex and p.agegr=t4.agegr and p.edu=t4.edu
	
	      left join
	      ( select sex, young_kid, young_kid_p
	        from param.lfp
	        where not missing(young_kid_p)
	      )t5
	      on p.sex=t5.sex and p.young_kid=t5.young_kid
	
		  left join
	      ( select sex, edu, young_kid, young_kid_edu_p
	        from param.lfp
	        where not missing(young_kid_edu_p)
	      )t6
	      on p.sex=t6.sex and p.edu=t6.edu and p.young_kid=t6.young_kid
	     
	     left join
	      ( select sex, region, region_p
	        from param.lfp
	        where not missing(region_p)
	      )t7
	      on p.sex=t7.sex and p.region=t7.region;
	quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Oct 2020 13:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688188#M209013</guid>
      <dc:creator>Demographer</dc:creator>
      <dc:date>2020-10-01T13:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688201#M209021</link>
      <description>&lt;P&gt;I have not gone through your code in any detail, but usually this is not necessary. Usually, if you want the regression coefficients in the same data set as the data, you can get this without macros and without all this SQL, but what is the purpose of doing this? Is it to use the coefficients and the data to create predictions? Then all of this has already been built into SAS so you don't have to program it yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, what is your goal in doing this?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688201#M209021</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-01T14:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688203#M209022</link>
      <description>&lt;P&gt;Thank you for your reply. The regression parameters are estimated from another dataset. I want to use them to impute variables to this new dataset.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688203#M209022</guid>
      <dc:creator>Demographer</dc:creator>
      <dc:date>2020-10-01T14:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688208#M209023</link>
      <description>&lt;P&gt;So, again it sounds to me like no macro and no complicated SQL is needed here. But I still have questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you say the parameters are estimated from another data set, are they estimated by PROC REG or PROC GLM or some other SAS PROC? Which one?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I want to use them to impute variables to this new dataset.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Does this mean you want to use the regression equation to predict values?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688208#M209023</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-01T14:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688217#M209026</link>
      <description>&lt;P&gt;Yes, I want to use the regression parameters to predict a value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The parameters are estimated with proc logistic, but the imputation need to be done independently of the regression. Eventually, the imputation will be done by people who don't have access to the dataset used for the regression.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:27:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688217#M209026</guid>
      <dc:creator>Demographer</dc:creator>
      <dc:date>2020-10-01T14:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688227#M209028</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/33143"&gt;@Demographer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Eventually, the imputation will be done by people who don't have access to the dataset used for the regression.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;In SAS, or elsewhere? How does your original code relate to the "eventually ..."? Is your question about how to do this today, or how to do this eventually when people don't have access to the data set?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:33:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688227#M209028</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-01T14:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688231#M209029</link>
      <description>&lt;P&gt;Sorry, maybe it's confusing. I'll say in other words.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The regression parameters are estimated from a dataset (pop1) that only me can access.&lt;/P&gt;
&lt;P&gt;I want to prepare a code showing to my students how imputing values in the dataset "pop2" from those regression parameters. My students won't have access to pop1, but have access to pop2 and to regression parameters (param.lfp).&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688231#M209029</guid>
      <dc:creator>Demographer</dc:creator>
      <dc:date>2020-10-01T14:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688238#M209032</link>
      <description>&lt;P&gt;It still bothers me that you keep saying "impute" and I am about to show the method to make predictions. So, are we really talking about the same thing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_plm_examples01.htm&amp;amp;locale=en" target="_self"&gt;example&lt;/A&gt; of PROC LOGISTIC, creating a model and storing the regression using the STORE statement. This is followed by a test data set being created and then PROC PLM uses the test data set and the STORE data set, but not the original data, to get predictions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this to work, you have to have access to SAS/STAT.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688238#M209032</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-01T14:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688242#M209033</link>
      <description>&lt;P&gt;You're showing us how you're currently doing the calculation without both datasets. What would be better is if you'd show us the input data sets and expected data sets and we could help you build a process that automates this. From the code a data step or SQL would work just as well but I can't help but wonder if VVALUEX() or an array may not make things simpler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/33143"&gt;@Demographer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry, maybe it's confusing. I'll say in other words.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The regression parameters are estimated from a dataset (pop1) that only me can access.&lt;/P&gt;
&lt;P&gt;I want to prepare a code showing to my students how imputing values in the dataset "pop2" from those regression parameters. My students won't have access to pop1, but have access to pop2 and to regression parameters (param.lfp).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688242#M209033</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-01T14:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688248#M209036</link>
      <description>&lt;P&gt;Thanks. Is the "sasuser.SimuModel" can somehow be exported in csv or some sas file, then imported in a new SAS session?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 15:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688248#M209036</guid>
      <dc:creator>Demographer</dc:creator>
      <dc:date>2020-10-01T15:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688254#M209038</link>
      <description>This presentation walks through how to score models. If that's your ultimate goal, then Paige Miller (once again) is correct in suggesting that doing a manual calculation isn't a good method to teach these days as there are easier methods. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3337-2019.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3337-2019.pdf&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Oct 2020 15:26:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688254#M209038</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-01T15:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688261#M209041</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/33143"&gt;@Demographer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks. Is the "sasuser.SimuModel" can somehow be exported in csv or some sas file, then imported in a new SAS session?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It is a SAS Data set that you can create and use later, with the proper LIBNAME statement. You can name it anything you want like MYFILES.LOGISTIC_REGRESSION&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 15:37:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688261#M209041</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-01T15:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688266#M209043</link>
      <description>&lt;P&gt;Have you investigated the CODE statement in proc logistic ?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 20:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688266#M209043</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-10-01T20:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688269#M209044</link>
      <description>I always forget about that one. &lt;BR /&gt;This blog post covers that one as well&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2014/02/19/scoring-a-regression-model-in-sas.html&lt;/A&gt;</description>
      <pubDate>Thu, 01 Oct 2020 15:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688269#M209044</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-01T15:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688275#M209046</link>
      <description>&lt;P&gt;Many thanks for all this. But I'm not sure if it works with what I have in mind.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to predict with random experiments and with different scenarios. For instance a scenario in which the value for low educated people is the same as for high educated ones. So I need to be able to change manually the parameters (which is why I used a csv file). The sas item exported with store the statement doesn't allow to change parameters afterward (or if so, it's not very obvious).&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 16:02:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688275#M209046</guid>
      <dc:creator>Demographer</dc:creator>
      <dc:date>2020-10-01T16:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688284#M209051</link>
      <description>&lt;P&gt;What the CODE statement produces is SAS program code, i.e. a text file. It can be edited with a simple text editor.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 16:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688284#M209051</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-10-01T16:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688311#M209063</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/33143"&gt;@Demographer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Many thanks for all this. But I'm not sure if it works with what I have in mind.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to predict with random experiments and with different scenarios.&lt;STRONG&gt; For instance a scenario in which the value for low educated people is the same as for high educated ones. So I need to be able to change manually the parameters (which is why I used a csv file).&lt;/STRONG&gt; The sas item exported with store the statement doesn't allow to change parameters afterward (or if so, it's not very obvious).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Are you manually changing the parameter estimates or using a different set of parameter estimates in different circumstances?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 18:12:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688311#M209063</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-01T18:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688313#M209064</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/33143"&gt;@Demographer&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Many thanks for all this. But I'm not sure if it works with what I have in mind.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to predict with random experiments and with different scenarios. For instance a scenario in which the value for low educated people is the same as for high educated ones. So I need to be able to change manually the parameters (which is why I used a csv file). The sas item exported with store the statement doesn't allow to change parameters afterward (or if so, it's not very obvious).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hello, this is new information. We have gone down a path, and then in the 15th or so message, we get this new information. This is not a good way to get useful answers to your questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please look at the CODE statement in PROC LOGISTIC, as suggested by others, and see if that meets your needs.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 18:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688313#M209064</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-01T18:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688447#M209132</link>
      <description>&lt;P&gt;Thank you all, but none of those options really fit what I need. I just want to make the SQL code shorter with a macro if possible.&lt;/P&gt;
&lt;P&gt;The code produced by the CODE statement is indeed much longer than my SQL code and much harder to understand and explain to SAS beginners. My objective is not to have the best method possible from a statistical point of view, but rather have the easiest to understand for master students in sociology.&lt;/P&gt;
&lt;P&gt;I'll do the prediction in a data step, such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	data work.pop_lfp2;
	set work.pop_lfp1;

	labour=0;
	if 15&amp;lt;=agegr&amp;lt;74 then do;
	exp_lab = exp(intercept + agegr_p + edu_p + agegr_edu_p + region_p);
	prob_lab = exp_lab/(1+exp_lab);

	if rand('uniform')&amp;lt;prob_lab then labour=1;
	end;
	
	drop intercept agegr_p edu_p agegr_edu_p region_p exp_lab prob_lab;
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 09:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688447#M209132</guid>
      <dc:creator>Demographer</dc:creator>
      <dc:date>2020-10-02T09:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help for a macro that merges files with proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688468#M209147</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;My objective is not to have the best method possible from a statistical point of view, but rather have the easiest to understand for master students in sociology.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Should that say, based on an earlier comment of yours: "My objective is not to have the best method possible from a statistical point of view, but rather have the easiest to understand for master students in sociology &lt;FONT color="#FF0000"&gt;and allow them to change the regression coefficients manually&lt;/FONT&gt;"?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If so, I consider this a very dangerous and suspicious thing to do. Just because you can do it (with the proper code) does not mean you should do it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then, this part is not correct&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;exp_lab = exp(intercept + agegr_p + edu_p + agegr_edu_p + region_p);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;the proper use of a regression equation from a logistic regression is&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;exp( intercept + x1*beta1 + x2*beta2 + ... )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;where x1,x2,... are the data set variables, and beta1, beta2, &lt;EM&gt;etc&lt;/EM&gt;. are the regression coefficients.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, since the CODE statement doesn't fit your needs and the STORE command doesn't fit your needs, then the only other thing I can think of here is to use PROC SCORE.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 10:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-for-a-macro-that-merges-files-with-proc-SQL/m-p/688468#M209147</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-02T10:40:06Z</dc:date>
    </item>
  </channel>
</rss>

