<?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: Fitting a quadratic model with a dummy variable involved in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531961#M145707</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;, I need the diagnostic plots. GLM doesn't help in writing out an equation. There are no coefficients to use in deriving or fitting my model. Thats why I opted for PROC REG please.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 13:18:48 GMT</pubDate>
    <dc:creator>JUMMY</dc:creator>
    <dc:date>2019-02-01T13:18:48Z</dc:date>
    <item>
      <title>Fitting a quadratic model with a dummy variable involved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531955#M145703</link>
      <description>&lt;P&gt;I need help with fitting a full quadratic model using PROC REG that contains two linear terms (sweetness and moisturecontent), two quadratic terms (sweetness^2 and moisturecontent^2) and the interaction term for the data below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data brand;
	input preference moisturecontent sweetness @@;
	if sweetness=2 then dummy=1;
    else if sweetness=4 then dummy=0;
  		dummy_moisture=dummy*moisturecontent;
	datalines;
	64 4 2 73 4 4 61 4 2 76 4 4 72 6 2 80 6 4 
	71 6 2 83 6 4 83 8 2 89 8 4 86 8 2 93 8 4
	88 10 2 95 10 4 94 10 2 100 10 4
	;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please use ONLY PROC REG in explaining.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531955#M145703</guid>
      <dc:creator>JUMMY</dc:creator>
      <dc:date>2019-02-01T12:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting a quadratic model with a dummy variable involved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531959#M145705</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226541"&gt;@JUMMY&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please use ONLY PROC REG in explaining.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I object to this restriction. You are only making life harder for yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, for anyone else reading along, this should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=have;
    class sweetness;
    model preference = sweetness | moisturecontent moisturecontent*moisturecontent;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:13:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531959#M145705</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-01T13:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting a quadratic model with a dummy variable involved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531961#M145707</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;, I need the diagnostic plots. GLM doesn't help in writing out an equation. There are no coefficients to use in deriving or fitting my model. Thats why I opted for PROC REG please.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:18:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531961#M145707</guid>
      <dc:creator>JUMMY</dc:creator>
      <dc:date>2019-02-01T13:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting a quadratic model with a dummy variable involved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531963#M145708</link>
      <description>&lt;P&gt;Your last line makes me wonder whether this is for a class? If so, you should say so. It enables the experts to give you hints and suggestions that can lead you towards the answer, instead of solving the problem for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can &lt;A href="https://blogs.sas.com/content/iml/2016/02/22/create-dummy-variables-in-sas.html" target="_self"&gt;use the GLMMOD procedure to generate the design matrix that contains the dummy variables&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glmmod data=brand outdesign=Design;
model preference = moisturecontent sweetness 
                   moisturecontent*moisturecontent
                   moisturecontent*sweetness 
                   sweetness*sweetness;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The columns od the DESIGN data set contain the dummy variables, which you can then use in PROC REG:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=Design;
model preference = col2-Col6;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In spite of your admonition to "&lt;SPAN&gt;ONLY [use] PROC REG in explaining," I feel compelled to point out that it is much&amp;nbsp;&lt;/SPAN&gt;easier to use PROC GLM and the CLASS statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=brand ;
model preference = moisturecontent sweetness 
                   moisturecontent*moisturecontent
                   moisturecontent*sweetness 
                   sweetness*sweetness;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ContourFit.gif" style="width: 384px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26756i2B9E14370D8E9BD1/image-size/large?v=v2&amp;amp;px=999" role="button" title="ContourFit.gif" alt="ContourFit.gif" /&gt;&lt;/span&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531963#M145708</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-02-01T13:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting a quadratic model with a dummy variable involved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531964#M145709</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;, I feel honored to have you comment on my post. Thank you so much for taking time to explain this to me.</description>
      <pubDate>Fri, 01 Feb 2019 13:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-a-quadratic-model-with-a-dummy-variable-involved/m-p/531964#M145709</guid>
      <dc:creator>JUMMY</dc:creator>
      <dc:date>2019-02-01T13:29:48Z</dc:date>
    </item>
  </channel>
</rss>

