<?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: Using estimate statement to generate simple slopes in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-to-generate-simple-slopes/m-p/762317#M37222</link>
    <description>Thanks for the advice of reconstituting. That is what I guessed. I am going to do this with a case statement in Proc SQL rather than a data statement because I work with sql a lot and rarely data statements.</description>
    <pubDate>Wed, 18 Aug 2021 15:39:16 GMT</pubDate>
    <dc:creator>noetsi</dc:creator>
    <dc:date>2021-08-18T15:39:16Z</dc:date>
    <item>
      <title>Using estimate statement to generate simple slopes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-to-generate-simple-slopes/m-p/761628#M37174</link>
      <description>&lt;P&gt;I have known of interaction for a long time. But I do not know how to code the&amp;nbsp; simple effects or graph them . I have not worked with estimate statements before.&amp;nbsp; The problem I have is I do not have the original categorical variable only the dummies derived from It. There were 5 levels in the original variable, I have four dummies in my data set. I assume I can just generate the interaction between my interval variable and the dummy variables (so there will be four interaction terms). But am not sure how I go from the following to that&amp;nbsp; or even if you can. The analysis I have seen focuses on the original categorical variable not its levels (the dummies built from it) which is part of my confusion. If there is aa simpler way to do this I will, it is the best code I have found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that before this step was a proc glm imported into proc plm.I found code how to generate results for an interaction of a categorical variable and an interval (hours) variable (the categorical variable prog has three levels the third is the reference level).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To plot the simple effects&lt;/P&gt;
&lt;DIV id="top" class="p-pageWrapper"&gt;
&lt;DIV class="p-body"&gt;
&lt;DIV class="p-body-inner"&gt;
&lt;DIV class="p-body-main  "&gt;
&lt;DIV class="p-body-content"&gt;
&lt;DIV class="p-body-pageContent"&gt;
&lt;DIV class="block block--messages" data-xf-init="inline-mod" data-href="/inline-mod/" data-type="post"&gt;
&lt;DIV class="block-container lbContainer" data-xf-init="lightbox select-to-quote" data-lb-universal="0" data-lb-id="thread-77474" data-message-selector=".js-post"&gt;
&lt;DIV class="block-body js-replyNewMessageContainer"&gt;
&lt;ARTICLE id="js-post-229369" class="message message--post js-post js-inlineModContainer  " data-author="noetsi" data-content="post-229369"&gt;
&lt;DIV class="message-inner"&gt;
&lt;DIV class="message-cell message-cell--main is-editing"&gt;&lt;FORM class="block" action="https://communities.sas.com/posts/229369/edit" method="post" data-xf-init="attachment-manager post-edit ajax-submit" data-preview-url="/posts/229369/preview"&gt;
&lt;DIV class="block-container"&gt;
&lt;DIV class="block-body"&gt;
&lt;DL class="formRow formRow--input formRow--fullWidth formRow--noLabel"&gt;
&lt;DD&gt;
&lt;DIV class="fr-box bbWrapper fr-ltr fr-basic fr-top"&gt;
&lt;DIV class="fr-wrapper" dir="ltr"&gt;
&lt;DIV class="fr-element fr-view" dir="ltr" contenteditable="true" spellcheck="true" aria-disabled="false"&gt;
&lt;P data-xf-p="1"&gt;proc plm restore = catcont;&lt;/P&gt;
&lt;P data-xf-p="1"&gt;estimate 'hours slope, prog=1 jogging' hours 1 hours*prog 1 0 0,&lt;/P&gt;
&lt;P data-xf-p="1"&gt;'hours slope, prog=2 swimming' hours 1 hours*prog 0 1 0,&lt;/P&gt;
&lt;P data-xf-p="1"&gt;'hours slope, prog=3 reading' hours 1 hours*prog 0 0 1 / e;&lt;/P&gt;
&lt;P data-xf-p="1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-xf-p="1"&gt;A similar problem this will plot the data, but I am not sure how to do it with the&amp;nbsp; dummies.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P data-xf-p="1"&gt;proc plm resore=catcont;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P data-xf-p="1"&gt;effectplot slicefit (x=hours sliceby=prog) / clm;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-xf-p="1"&gt;&amp;nbsp;run;&lt;/P&gt;
&lt;P data-xf-p="1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-xf-p="1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DD&gt;
&lt;/DL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/FORM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/ARTICLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 01:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-to-generate-simple-slopes/m-p/761628#M37174</guid>
      <dc:creator>noetsi</dc:creator>
      <dc:date>2021-08-15T01:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using estimate statement to generate simple slopes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-to-generate-simple-slopes/m-p/761653#M37176</link>
      <description>&lt;P&gt;If you are looking for a simple solution to estimate the intercept and the slope :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=sashelp.class;
class sex;
model weight= sex height(sex)/ss3 noint solution;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You will get the intercepts and slopes directly:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="gcjfernandez_gmail_com_0-1629011698154.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62596iC724A1EE060CB597/image-size/large?v=v2&amp;amp;px=999" role="button" title="gcjfernandez_gmail_com_0-1629011698154.png" alt="gcjfernandez_gmail_com_0-1629011698154.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 07:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-to-generate-simple-slopes/m-p/761653#M37176</guid>
      <dc:creator>gcjfernandez</dc:creator>
      <dc:date>2021-08-15T07:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using estimate statement to generate simple slopes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-to-generate-simple-slopes/m-p/761813#M37192</link>
      <description>&lt;P&gt;Do not use the ESTIMATE statement. Instead use the SLICE statement to estimate and graph the effects in the interaction. There are plenty of examples at support.sas.com such as in &lt;A href="http://support.sas.com/kb/24447" target="_self"&gt;this note&lt;/A&gt; and &lt;A href="http://support.sas.com/kb/24455" target="_self"&gt;this note&lt;/A&gt;. To do that, you need to reconstruct the original categorical variables from the dummy variables you have. That is easily done in a DATA step. For example, if you have 3 dummy variables (A, B, and C) for a 4-level categorical variable, then something like the following will produce a single categorical variable (GRP) that you can use in the CLASS, MODEL, and SLICE statements..&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
set old
if a=1 then grp='A';
else if b=1 then grp='B';
else if c=1 then grp='C';
else grp='D';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Aug 2021 14:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-to-generate-simple-slopes/m-p/761813#M37192</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-08-16T14:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using estimate statement to generate simple slopes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-to-generate-simple-slopes/m-p/762317#M37222</link>
      <description>Thanks for the advice of reconstituting. That is what I guessed. I am going to do this with a case statement in Proc SQL rather than a data statement because I work with sql a lot and rarely data statements.</description>
      <pubDate>Wed, 18 Aug 2021 15:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-estimate-statement-to-generate-simple-slopes/m-p/762317#M37222</guid>
      <dc:creator>noetsi</dc:creator>
      <dc:date>2021-08-18T15:39:16Z</dc:date>
    </item>
  </channel>
</rss>

