<?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: Proc Reg versus Proc GLM using indicator variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470071#M120309</link>
    <description>&lt;PRE&gt;proc reg data=herbs;&lt;BR /&gt;model weight = fertilizer;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;produces this error:&lt;/P&gt;&lt;P&gt;104&amp;nbsp; &amp;nbsp; &amp;nbsp; model weight=fertilizer&lt;/P&gt;&lt;P&gt;ERROR:&amp;nbsp; Variable fertilizer in list does not match type prescribed for this list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and yes this is an assignment.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jun 2018 19:57:32 GMT</pubDate>
    <dc:creator>SummerSol</dc:creator>
    <dc:date>2018-06-13T19:57:32Z</dc:date>
    <item>
      <title>Proc Reg versus Proc GLM using indicator variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470059#M120304</link>
      <description>&lt;P&gt;Please assist with creating a proc reg and proc glm for the data below.&lt;/P&gt;&lt;P&gt;I have the proc reg statement; however I am unable to produce an output.&lt;/P&gt;&lt;P&gt;Can anyone explain what I am missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1.&lt;/SPAN&gt;Add a proc reg to your program to produce a regression with the two indicator variables.&lt;BR /&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;Add a proc glm to your program that produces the ANOVA output using fertilizer as the class variable.&lt;/P&gt;&lt;P&gt;3. Compare both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* create the dataset "herbs";&lt;BR /&gt;data herbs;&lt;BR /&gt;*input the variables, weight is the dry weight in grams, the fertilizer is A,B,or C;&lt;BR /&gt;input weight fertilizer$;&lt;BR /&gt;*use if then statements to create indicator variables;&lt;BR /&gt;if fertilizer='A' then A=1;else A=0;&lt;BR /&gt;if fertilizer='B' then B=1; else B=0;&lt;BR /&gt;*bring in the data through datalines;&lt;BR /&gt;datalines;&lt;BR /&gt;16.2 A&lt;BR /&gt;20.3 A&lt;BR /&gt;24.4 A&lt;BR /&gt;21.2 A&lt;BR /&gt;20.9 A&lt;BR /&gt;14.2 A&lt;BR /&gt;23.1 B&lt;BR /&gt;25.1 B&lt;BR /&gt;27.5 B&lt;BR /&gt;27.2 B&lt;BR /&gt;31.9 B&lt;BR /&gt;27.5 B&lt;BR /&gt;19.6 C&lt;BR /&gt;23.0 C&lt;BR /&gt;15.8 C&lt;BR /&gt;28.3 C&lt;BR /&gt;18.0 C&lt;BR /&gt;17.1 C&lt;BR /&gt;;&lt;BR /&gt;*print the dataset herbs to confirm that the varaibles were read in correctly;&lt;BR /&gt;proc print data=herbs;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc reg;&lt;/P&gt;&lt;P&gt;model weight=fertilizer$;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470059#M120304</guid>
      <dc:creator>SummerSol</dc:creator>
      <dc:date>2018-06-13T19:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Reg versus Proc GLM using indicator variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470063#M120305</link>
      <description>&lt;P&gt;proc reg; &lt;STRONG&gt;&amp;lt;- no data statement - what is the data source here?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;model weight=fertilizer$; &lt;STRONG&gt;&amp;lt;- why is there a dollar sign here? Use the name indicated in your data set, from the proc print or run a proc contents to see the name.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If something is not working, please include your log to show what errors you're getting. And if you're not sure how to use a PROC, see the examples and run the code to see how to set up your data and code.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215419"&gt;@SummerSol&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Please assist with creating a proc reg and proc glm for the data below.&lt;/P&gt;
&lt;P&gt;I have the proc reg statement; however I am unable to produce an output.&lt;/P&gt;
&lt;P&gt;Can anyone explain what I am missing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My goal is to:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1.&lt;/SPAN&gt;Add a proc reg to your program to produce a regression with the two indicator variables.&lt;BR /&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;Add a proc glm to your program that produces the ANOVA output using fertilizer as the class variable.&lt;/P&gt;
&lt;P&gt;3. Compare both.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* create the dataset "herbs";&lt;BR /&gt;data herbs;&lt;BR /&gt;*input the variables, weight is the dry weight in grams, the fertilizer is A,B,or C;&lt;BR /&gt;input weight fertilizer$;&lt;BR /&gt;*use if then statements to create indicator variables;&lt;BR /&gt;if fertilizer='A' then A=1;else A=0;&lt;BR /&gt;if fertilizer='B' then B=1; else B=0;&lt;BR /&gt;*bring in the data through datalines;&lt;BR /&gt;datalines;&lt;BR /&gt;16.2 A&lt;BR /&gt;20.3 A&lt;BR /&gt;24.4 A&lt;BR /&gt;21.2 A&lt;BR /&gt;20.9 A&lt;BR /&gt;14.2 A&lt;BR /&gt;23.1 B&lt;BR /&gt;25.1 B&lt;BR /&gt;27.5 B&lt;BR /&gt;27.2 B&lt;BR /&gt;31.9 B&lt;BR /&gt;27.5 B&lt;BR /&gt;19.6 C&lt;BR /&gt;23.0 C&lt;BR /&gt;15.8 C&lt;BR /&gt;28.3 C&lt;BR /&gt;18.0 C&lt;BR /&gt;17.1 C&lt;BR /&gt;;&lt;BR /&gt;*print the dataset herbs to confirm that the varaibles were read in correctly;&lt;BR /&gt;proc print data=herbs;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc reg;&lt;/P&gt;
&lt;P&gt;model weight=fertilizer$;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:45:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470063#M120305</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-13T19:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Reg versus Proc GLM using indicator variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470064#M120306</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215419"&gt;@SummerSol&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My goal is to:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1.&lt;/SPAN&gt;Add a proc reg to your program to produce a regression with the two indicator variables.&lt;BR /&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;Add a proc glm to your program that produces the ANOVA output using fertilizer as the class variable.&lt;/P&gt;
&lt;P&gt;3. Compare both.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Essentially, REG does not operate on categorical variables, they must be numeric. So, you could create columns of numeric 0s and 1s (dummy variables) to trick REG into doing the analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, you say "your goal is to:" even though this sounds very much like a homework assignment. If it is not a homework assignment, there's really no need for you to do both and compare them, the answer is well known.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:46:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470064#M120306</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-13T19:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Reg versus Proc GLM using indicator variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470071#M120309</link>
      <description>&lt;PRE&gt;proc reg data=herbs;&lt;BR /&gt;model weight = fertilizer;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;produces this error:&lt;/P&gt;&lt;P&gt;104&amp;nbsp; &amp;nbsp; &amp;nbsp; model weight=fertilizer&lt;/P&gt;&lt;P&gt;ERROR:&amp;nbsp; Variable fertilizer in list does not match type prescribed for this list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and yes this is an assignment.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470071#M120309</guid>
      <dc:creator>SummerSol</dc:creator>
      <dc:date>2018-06-13T19:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Reg versus Proc GLM using indicator variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470074#M120311</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215419"&gt;@SummerSol&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;proc reg data=herbs;&lt;BR /&gt;model weight = fertilizer;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;produces this error:&lt;/P&gt;
&lt;P&gt;104&amp;nbsp; &amp;nbsp; &amp;nbsp; model weight=fertilizer&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR:&amp;nbsp; Variable fertilizer in list does not match type prescribed for this list.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and yes this is an assignment.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;This type of error means fertilizer is a character and you need numeric variables to do regression in PROC REG. You did create the dummy variables (A, B) but didn't use them.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470074#M120311</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-13T19:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Reg versus Proc GLM using indicator variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470077#M120313</link>
      <description>Thanks Paige. This is for a class assignment. I was just seeking help since this is my first class and I exhausted all my other resources.</description>
      <pubDate>Wed, 13 Jun 2018 20:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470077#M120313</guid>
      <dc:creator>SummerSol</dc:creator>
      <dc:date>2018-06-13T20:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Reg versus Proc GLM using indicator variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470110#M120324</link>
      <description>&lt;PRE&gt;proc reg data=herbs;&lt;BR /&gt;model weight = A B;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc glm data=herbs;&lt;BR /&gt;class fertilizer;&lt;BR /&gt;model weight = fertilizer;&lt;/PRE&gt;&lt;P&gt;Thanks.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 20:39:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470110#M120324</guid>
      <dc:creator>SummerSol</dc:creator>
      <dc:date>2018-06-13T20:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Reg versus Proc GLM using indicator variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470114#M120328</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215419"&gt;@SummerSol&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;proc reg data=herbs;&lt;BR /&gt;model weight = A B;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc glm data=herbs;&lt;BR /&gt;class fertilizer;&lt;BR /&gt;model weight = fertilizer;&lt;/PRE&gt;
&lt;P&gt;Thanks.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For A/B you wouldn't include both because it seems fertilizer has only 2 levels. This means you should have 1 dummy variable, not two. PROC GLM uses the over parameterized model though, so this would match that, but it's not good practice.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 20:44:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470114#M120328</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-13T20:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Reg versus Proc GLM using indicator variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470128#M120339</link>
      <description>&lt;P&gt;Thanks for the feedback. It was helpful&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 21:45:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Reg-versus-Proc-GLM-using-indicator-variables/m-p/470128#M120339</guid>
      <dc:creator>SummerSol</dc:creator>
      <dc:date>2018-06-13T21:45:45Z</dc:date>
    </item>
  </channel>
</rss>

