<?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 create multiple regresion models from a list in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713896#M34502</link>
    <description>&lt;P&gt;Ok. First off, let us create one PROC GLM step for each combination in the correlaciones data set. You can do this with Call Execute Logic like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice that I have commented out the Call Execute Statement, since I don't have your data. You can see the generated code in the c variable in the Callstack data set. Each model creates an output data set Model+N in the work library.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should get you started. Feel free to ask &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data correlaciones;
input v1 $ v2 $ v3 $ v4 $;
cards;
_9198 _9446 _9452 _9200
_9952 _9773 _9766 _9717
_9489 _9487 _9477 _9898
_9717 _9766 _9726 _9773
_9822 _9814 _9815 _9862
_9773 _9952 _9766 _9717
_9446 _9452 _9198 _9814
_9913 _9878 _9916 _9874
_9908 _9910 _9898 _9874
_9452 _9946 _9814 _9198
_9898 _9896 _9862 _9874
_9766 _9773 _9952 _9717
_9726 _9717 _9766 _9773
_9815 _9814 _9452 _9200
_9896 _9898 _9487 _9862
_9874 _9898 _9862 _9910
_9910 _9908 _9874 _9878
_9814 _9815 _9452 _9200
_9862 _9898 _9874 _9896
_9477 _9487 _9489 _9898
_9878 _9913 _9916 _9874
_9200 _9452 _9814 _9815
_9916 _9878 _9913 _9874
_9487 _9489 _9477 _9898
;
run;

data callstack;
   set correlaciones;
   c = compbl(cat(
   "proc glm data = tabla.transpuesto_lluvia plots=none outstat = model", _N_, ";
      model ", v1, " = ", v2, " ", v3, " ", v4, ";
    run;"
    ));
   *call execute(c);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 25 Jan 2021 14:05:42 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2021-01-25T14:05:42Z</dc:date>
    <item>
      <title>How to create multiple regresion models from a list</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713890#M34497</link>
      <description>&lt;P&gt;Greetings, this is my first time using this webpage and I would appreciate if you could help me out. I need to create several linear models like the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=tabla.transpuesto_lluvia plots=none;
	model _9198 =_9446 _9452 _9200;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;_9198, _9446, etc. are variables from a database (tabla.transpuesto_lluvia). My problem is that I have over 20 variables to model and I was wondering if I could autome the process with this idea in mind:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=tabla.transpuesto_lluvia plots=none;
	model v1 =v2 v3 v4;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;These are the combination of variables that I want to model, being the first row the one in the example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tabla.correlaciones;
input v1 $ v2 $ v3 $ v4 $;
cards;
_9198 _9446 _9452 _9200
_9952 _9773 _9766 _9717
_9489 _9487 _9477 _9898
_9717 _9766 _9726 _9773
_9822 _9814 _9815 _9862
_9773 _9952 _9766 _9717
_9446 _9452 _9198 _9814
_9913 _9878 _9916 _9874
_9908 _9910 _9898 _9874
_9452 _9946 _9814 _9198
_9898 _9896 _9862 _9874
_9766 _9773 _9952 _9717
_9726 _9717 _9766 _9773
_9815 _9814 _9452 _9200
_9896 _9898 _9487 _9862
_9874 _9898 _9862 _9910
_9910 _9908 _9874 _9878
_9814 _9815 _9452 _9200
_9862 _9898 _9874 _9896
_9477 _9487 _9489 _9898
_9878 _9913 _9916 _9874
_9200 _9452 _9814 _9815
_9916 _9878 _9913 _9874
_9487 _9489 _9477 _9898
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any idea of how could I create multiple models thanks to this last combination of variables? Thank you for your time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 13:49:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713890#M34497</guid>
      <dc:creator>Devir</dc:creator>
      <dc:date>2021-01-25T13:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple regresion models from a list</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713892#M34498</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/365588"&gt;@Devir&lt;/a&gt;&amp;nbsp;Hi and welcome to the SAS Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sure, this is possible. What is your desired result here? HTML output or SAS data sets?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 13:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713892#M34498</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-01-25T13:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple regresion models from a list</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713894#M34500</link>
      <description>I need to make some predictions with these models, so I think Im going to need a dataset to work with.&lt;BR /&gt;Thank you for your welcome!</description>
      <pubDate>Mon, 25 Jan 2021 14:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713894#M34500</guid>
      <dc:creator>Devir</dc:creator>
      <dc:date>2021-01-25T14:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple regresion models from a list</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713896#M34502</link>
      <description>&lt;P&gt;Ok. First off, let us create one PROC GLM step for each combination in the correlaciones data set. You can do this with Call Execute Logic like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice that I have commented out the Call Execute Statement, since I don't have your data. You can see the generated code in the c variable in the Callstack data set. Each model creates an output data set Model+N in the work library.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This should get you started. Feel free to ask &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data correlaciones;
input v1 $ v2 $ v3 $ v4 $;
cards;
_9198 _9446 _9452 _9200
_9952 _9773 _9766 _9717
_9489 _9487 _9477 _9898
_9717 _9766 _9726 _9773
_9822 _9814 _9815 _9862
_9773 _9952 _9766 _9717
_9446 _9452 _9198 _9814
_9913 _9878 _9916 _9874
_9908 _9910 _9898 _9874
_9452 _9946 _9814 _9198
_9898 _9896 _9862 _9874
_9766 _9773 _9952 _9717
_9726 _9717 _9766 _9773
_9815 _9814 _9452 _9200
_9896 _9898 _9487 _9862
_9874 _9898 _9862 _9910
_9910 _9908 _9874 _9878
_9814 _9815 _9452 _9200
_9862 _9898 _9874 _9896
_9477 _9487 _9489 _9898
_9878 _9913 _9916 _9874
_9200 _9452 _9814 _9815
_9916 _9878 _9913 _9874
_9487 _9489 _9477 _9898
;
run;

data callstack;
   set correlaciones;
   c = compbl(cat(
   "proc glm data = tabla.transpuesto_lluvia plots=none outstat = model", _N_, ";
      model ", v1, " = ", v2, " ", v3, " ", v4, ";
    run;"
    ));
   *call execute(c);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jan 2021 14:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713896#M34502</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-01-25T14:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple regresion models from a list</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713902#M34504</link>
      <description>Thanks for your answer! I'll try.</description>
      <pubDate>Mon, 25 Jan 2021 14:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713902#M34504</guid>
      <dc:creator>Devir</dc:creator>
      <dc:date>2021-01-25T14:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple regresion models from a list</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713904#M34505</link>
      <description>&lt;P&gt;PROC GLM should end with a QUIT; and not a RUN;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 14:32:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-create-multiple-regresion-models-from-a-list/m-p/713904#M34505</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-25T14:32:20Z</dc:date>
    </item>
  </channel>
</rss>

